cryptgeon/src/main.rs

24 lines
558 B
Rust
Raw Normal View History

2021-05-02 10:32:03 +00:00
use actix_web::{middleware, web, App, HttpServer};
2021-05-01 10:39:40 +00:00
#[macro_use]
extern crate lazy_static;
2021-05-02 10:32:03 +00:00
mod client;
2021-05-01 10:39:40 +00:00
mod note;
2021-05-02 10:32:03 +00:00
mod store;
2021-05-01 10:39:40 +00:00
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.wrap(middleware::Compress::default())
.wrap(middleware::DefaultHeaders::default())
.configure(note::init)
2021-05-02 10:32:03 +00:00
.configure(client::init)
.default_service(web::resource("").route(web::get().to(client::fallback_fn)))
2021-05-01 10:39:40 +00:00
})
2021-05-02 11:53:48 +00:00
.bind("0.0.0.0:5000")?
2021-05-01 10:39:40 +00:00
.run()
.await
}