feat: replace my_codegen with actix_web_codegen_const_routes

This commit is contained in:
Aravinth Manivannan 2022-09-10 18:31:05 +05:30
parent d6fc9ad67f
commit 086c4f5911
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
5 changed files with 14 additions and 13 deletions

16
Cargo.lock generated
View file

@ -144,7 +144,7 @@ dependencies = [
"actix-server",
"actix-service",
"actix-utils",
"actix-web-codegen 4.0.1",
"actix-web-codegen",
"ahash",
"bytes",
"bytestring",
@ -172,8 +172,9 @@ dependencies = [
[[package]]
name = "actix-web-codegen"
version = "4.0.0"
source = "git+https://github.com/realaravinth/actix-web#8a399b6e7ea6ffdf241d07a9e907b1afff7e0fe6"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f270541caec49c15673b0af0e9a00143421ad4f118d2df7edcb68b627632f56"
dependencies = [
"actix-router",
"proc-macro2",
@ -182,10 +183,9 @@ dependencies = [
]
[[package]]
name = "actix-web-codegen"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f270541caec49c15673b0af0e9a00143421ad4f118d2df7edcb68b627632f56"
name = "actix-web-codegen-const-routes"
version = "0.1.0"
source = "git+https://github.com/realaravinth/actix-web-codegen-const-routes?tag=0.1.0#1cc9b8dbaaef4b3634dabbf537f313200dd91bd9"
dependencies = [
"actix-router",
"proc-macro2",
@ -920,7 +920,7 @@ dependencies = [
"actix-http",
"actix-rt",
"actix-web",
"actix-web-codegen 4.0.0",
"actix-web-codegen-const-routes",
"config",
"derive_more",
"git2",

View file

@ -16,7 +16,8 @@ authors = ["realaravinth <realaravinth@batsense.net>"]
actix-web = "4.0.1"
actix-http = "3.0.4"
actix-rt = "2"
my-codegen = {package = "actix-web-codegen", git ="https://github.com/realaravinth/actix-web"}
actix-web-codegen-const-routes = { version = "0.1.0", tag = "0.1.0", git = "https://github.com/realaravinth/actix-web-codegen-const-routes" }
config = "0.13"
git2 = "0.14.2"

View file

@ -53,7 +53,7 @@ pub fn find_page<'a>(secret: &str, ctx: &'a AppCtx) -> Option<&'a Page> {
None
}
#[my_codegen::post(path = "crate::V1_API_ROUTES.deploy.update")]
#[actix_web_codegen_const_routes::post(path = "crate::V1_API_ROUTES.deploy.update")]
async fn update(payload: web::Json<DeployEvent>, ctx: AppCtx) -> ServiceResult<impl Responder> {
if let Some(page) = find_page(&payload.secret, &ctx) {
let (tx, rx) = oneshot::channel();
@ -98,7 +98,7 @@ impl DeployInfo {
}
}
#[my_codegen::post(path = "crate::V1_API_ROUTES.deploy.info")]
#[actix_web_codegen_const_routes::post(path = "crate::V1_API_ROUTES.deploy.info")]
async fn deploy_info(
payload: web::Json<DeploySecret>,
ctx: AppCtx,

View file

@ -43,7 +43,7 @@ pub mod routes {
}
/// emmits build details of the bninary
#[my_codegen::get(path = "crate::V1_API_ROUTES.meta.build_details")]
#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.meta.build_details")]
async fn build_details(ctx: AppCtx) -> impl Responder {
let build = BuildDetails {
version: VERSION,

View file

@ -47,7 +47,7 @@ pub fn find_page<'a>(domain: &str, ctx: &'a AppCtx) -> Option<&'a Page> {
None
}
#[my_codegen::get(path = "crate::V1_API_ROUTES.serve.catch_all")]
#[actix_web_codegen_const_routes::get(path = "crate::V1_API_ROUTES.serve.catch_all")]
async fn index(req: HttpRequest, ctx: AppCtx) -> ServiceResult<impl Responder> {
let c = req.connection_info();
let mut host = c.host();