29 lines
656 B
Rust
29 lines
656 B
Rust
extern crate core;
|
|
|
|
mod helpers;
|
|
mod middlewares;
|
|
mod models;
|
|
mod routes;
|
|
mod schema;
|
|
|
|
use crate::helpers::db;
|
|
use actix_web::{web, App, HttpServer};
|
|
|
|
#[actix_web::main]
|
|
async fn main() -> std::io::Result<()> {
|
|
dotenvy::dotenv().expect("No .env file found");
|
|
std::env::set_var("RUST_LOG", "debug");
|
|
|
|
db::init();
|
|
|
|
HttpServer::new(move || {
|
|
App::new()
|
|
.service(web::scope("/playlists").service(routes::playlists::get_playlist))
|
|
.service(routes::auth::login)
|
|
.service(routes::me::routes())
|
|
.service(routes::users::routes())
|
|
})
|
|
.bind(("127.0.0.1", 9000))?
|
|
.run()
|
|
.await
|
|
}
|