aaaaaaaaaaaa

This commit is contained in:
Gvidas Juknevičius 2024-03-30 17:42:11 +02:00
parent cbb8fe9555
commit d0defb101e
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
3 changed files with 11 additions and 8 deletions

View File

@ -1,12 +1,13 @@
pub mod webhooks;
mod webhooks;
use actix_web::Scope;
use actix_web::{web, HttpResponse, Scope};
pub fn get_scope() -> Scope {
Scope::new("/api")
.route("/", web::get().to(HttpResponse::Ok))
.service(
webhooks::get_scope()
)

View File

@ -3,14 +3,15 @@ pub mod events;
use std::{borrow::BorrowMut, sync::Mutex};
use actix_web::{http::header, web::{self, Bytes, Data}, HttpRequest, HttpResponse, Resource, Responder, Result, Scope};
use actix_web::{http::header, web::{self, Bytes, Data}, HttpRequest, HttpResponse, Responder, Result, Scope};
use crate::database::{models, Database};
pub fn get_scope() -> Resource {
web::resource("/").route(
web::route().to(handler)
)
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> {

View File

@ -1,10 +1,11 @@
use actix_web::Scope;
use actix_web::{web, HttpResponse, Scope};
pub mod github;
pub fn get_scope() -> Scope {
Scope::new("/wh")
.route("/", web::get().to(HttpResponse::Ok))
.service(
github::get_scope()
)