aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2020-12-04 21:53:08 -0800
committerFuwn <[email protected]>2020-12-04 21:53:08 -0800
commit299ef187bb83345ca12796e56a7b5ed8d2e04c67 (patch)
tree44768f0b39ac20755b213c72918cf98f614ff122 /src/main.rs
parentchore: update log (diff)
downloadchan-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.rs43
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
}