19 lines
485 B
Rust
19 lines
485 B
Rust
use actix_web::{web, App, HttpServer};
|
|
use colota_backend::{create_pool, DbPool};
|
|
pub use colota_backend::schema;
|
|
pub use colota_backend::models;
|
|
pub use colota_backend::routes;
|
|
|
|
#[actix_web::main]
|
|
async fn main() -> std::io::Result<()> {
|
|
let pool: DbPool = create_pool();
|
|
|
|
HttpServer::new(move || {
|
|
App::new()
|
|
.app_data(web::Data::new(pool.clone()))
|
|
.configure(routes::config_routes)
|
|
})
|
|
.bind(("0.0.0.0", 8080))?
|
|
.run()
|
|
.await
|
|
} |