using custom version of actix-codegen and cors for pow routes

This commit is contained in:
realaravinth
2021-05-25 14:34:24 +05:30
parent 0421cb681c
commit 72667bd2e1
26 changed files with 334 additions and 363 deletions

View File

@@ -37,11 +37,8 @@ lazy_static! {
static ref INDEX: String = IndexPage::default().render_once().unwrap();
}
const ROUTE: &str = PAGES.auth.login;
#[get(path="ROUTE")]
#[get(path="PAGES.auth.login")]
pub async fn login() -> impl Responder {
struct Foo;
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(&*INDEX)

View File

@@ -19,12 +19,8 @@ pub mod login;
pub mod register;
pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
use crate::define_resource;
use crate::PAGES;
cfg.service(login::login);
// define_resource!(cfg, PAGES.auth.login, Methods::Get, login::login);
define_resource!(cfg, PAGES.auth.join, Methods::Get, register::join);
cfg.service(register::join);
}
pub mod routes {

View File

@@ -35,6 +35,7 @@ lazy_static! {
static ref INDEX: String = IndexPage::default().render_once().unwrap();
}
#[my_codegen::get(path = "crate::PAGES.auth.join")]
pub async fn join() -> impl Responder {
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")