From cbb8fe95555d7c9dec6b2cb80fbd3c00be28b081 Mon Sep 17 00:00:00 2001 From: MCorange99 Date: Sat, 30 Mar 2024 17:29:01 +0200 Subject: [PATCH] changed api apth --- src/web/mod.rs | 1 - src/web/routes/api/webhooks/github/mod.rs | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/web/mod.rs b/src/web/mod.rs index 034a1cc..ea9ccec 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -20,7 +20,6 @@ pub(crate) async fn start_actix(config: &Config, database: Database) -> anyhow:: .service(actix_fs::Files::new("/static", "./static").index_file("index.html")) // static directory .service(web::redirect("/favicon.ico", "/static/favicon.ico")) //? special redirect for favicon }) - .bind(bindip)? .run() .await?; diff --git a/src/web/routes/api/webhooks/github/mod.rs b/src/web/routes/api/webhooks/github/mod.rs index 9816654..83342b7 100644 --- a/src/web/routes/api/webhooks/github/mod.rs +++ b/src/web/routes/api/webhooks/github/mod.rs @@ -3,16 +3,14 @@ pub mod events; use std::{borrow::BorrowMut, sync::Mutex}; -use actix_web::{http::header, web::{self, Bytes, Data}, HttpRequest, HttpResponse, Responder, Result, Scope}; +use actix_web::{http::header, web::{self, Bytes, Data}, HttpRequest, HttpResponse, Resource, Responder, Result, Scope}; use crate::database::{models, Database}; -pub fn get_scope() -> Scope { - Scope::new("/github") - .service( - web::resource("/") - .to(handler) - ) +pub fn get_scope() -> Resource { + web::resource("/").route( + web::route().to(handler) + ) } pub async fn handler(req: HttpRequest, body: Bytes, db: Data>) -> Result {