uwu
This commit is contained in:
parent
d0defb101e
commit
74dd2bf6d9
|
@ -7,13 +7,6 @@ use actix_web::{http::header, web::{self, Bytes, Data}, HttpRequest, HttpRespons
|
||||||
|
|
||||||
use crate::database::{models, Database};
|
use crate::database::{models, Database};
|
||||||
|
|
||||||
pub fn get_scope() -> Scope {
|
|
||||||
Scope::new("/github")
|
|
||||||
.route("/", web::get().to(HttpResponse::Ok))
|
|
||||||
.route("/", web::post().to(handler))
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn handler(req: HttpRequest, body: Bytes, db: Data<Mutex<Database>>) -> Result<impl Responder> {
|
pub async fn handler(req: HttpRequest, body: Bytes, db: Data<Mutex<Database>>) -> Result<impl Responder> {
|
||||||
let Some(auth) = req.headers().get(header::AUTHORIZATION) else {
|
let Some(auth) = req.headers().get(header::AUTHORIZATION) else {
|
||||||
return Ok(HttpResponse::Unauthorized());
|
return Ok(HttpResponse::Unauthorized());
|
||||||
|
|
|
@ -6,7 +6,6 @@ pub mod github;
|
||||||
pub fn get_scope() -> Scope {
|
pub fn get_scope() -> Scope {
|
||||||
Scope::new("/wh")
|
Scope::new("/wh")
|
||||||
.route("/", web::get().to(HttpResponse::Ok))
|
.route("/", web::get().to(HttpResponse::Ok))
|
||||||
.service(
|
.route("/github", web::get().to(HttpResponse::Ok))
|
||||||
github::get_scope()
|
.route("/github", web::post().to(github::handler))
|
||||||
)
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user