diff options
| author | Fuwn <[email protected]> | 2020-12-04 21:53:08 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-12-04 21:53:08 -0800 |
| commit | 299ef187bb83345ca12796e56a7b5ed8d2e04c67 (patch) | |
| tree | 44768f0b39ac20755b213c72918cf98f614ff122 /src/main.rs | |
| parent | chore: update log (diff) | |
| download | chan-test_actix-yarte.tar.xz chan-test_actix-yarte.zip | |
not working loltest_actix-yarte
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs index c9afc46..8a1548a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,20 +11,33 @@ mod db; mod structures; use rocket_contrib::templates::Template; +use actix_web::{ + error::ErrorInternalServerError, get, middleware::Logger, web, + App, Error, HttpResponse, HttpServer +}; -fn main() { - rocket::ignite() - .attach(Template::fairing()) - .register(catchers![ - ui::not_found - ]) - .mount("/", routes![ - ui::index, - ui::boards, - ui::board - ]) - .mount("/api/v1/", routes![ - api::post - ]) - .launch(); +#[actix_web::main] +async fn main() -> std::io::Result<()> { + // rocket::ignite() + // .attach(Template::fairing()) + // .register(catchers![ + // ui::not_found + // ]) + // .mount("/", routes![ + // ui::index, + // ui::boards, + // ui::board + // ]) + // .mount("/api/v1/", routes![ + // api::post + // ]) + // .launch(); + + HttpServer::new(move || App::new().wrap(Logger::default()) + .service(ui::index) + .service(ui::boards) + ) + .bind("127.0.0.1:8000")? + .run() + .await } |