aaaaaaaaaaaa
This commit is contained in:
parent
cbb8fe9555
commit
d0defb101e
|
@ -1,12 +1,13 @@
|
||||||
pub mod webhooks;
|
mod webhooks;
|
||||||
|
|
||||||
use actix_web::Scope;
|
use actix_web::{web, HttpResponse, Scope};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pub fn get_scope() -> Scope {
|
pub fn get_scope() -> Scope {
|
||||||
Scope::new("/api")
|
Scope::new("/api")
|
||||||
|
.route("/", web::get().to(HttpResponse::Ok))
|
||||||
.service(
|
.service(
|
||||||
webhooks::get_scope()
|
webhooks::get_scope()
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,14 +3,15 @@ pub mod events;
|
||||||
|
|
||||||
use std::{borrow::BorrowMut, sync::Mutex};
|
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};
|
use crate::database::{models, Database};
|
||||||
|
|
||||||
pub fn get_scope() -> Resource {
|
pub fn get_scope() -> Scope {
|
||||||
web::resource("/").route(
|
Scope::new("/github")
|
||||||
web::route().to(handler)
|
.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> {
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
use actix_web::Scope;
|
use actix_web::{web, HttpResponse, Scope};
|
||||||
|
|
||||||
pub mod github;
|
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))
|
||||||
.service(
|
.service(
|
||||||
github::get_scope()
|
github::get_scope()
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user