backend: remove unused imports
This commit is contained in:
parent
2f136fbb01
commit
4a9fba6d0e
1 changed files with 9 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
use actix_web::{web, App, HttpResponse, HttpServer, Responder};
|
||||
use actix_web::{web, App, HttpServer};
|
||||
use migration::MigratorTrait;
|
||||
use sea_orm::{Database, DatabaseConnection};
|
||||
use std::env;
|
||||
|
||||
|
@ -24,8 +25,15 @@ async fn main() -> std::io::Result<()> {
|
|||
.await
|
||||
.expect("Connecting to Database failed");
|
||||
|
||||
println!("Running Migrations");
|
||||
migration::Migrator::up(&conn, None)
|
||||
.await
|
||||
.expect("Running migrations failed");
|
||||
println!("Finished running migrations");
|
||||
|
||||
let state = AppState { db: conn };
|
||||
|
||||
println!("Listening for connections...");
|
||||
HttpServer::new(move || {
|
||||
let cors = if cfg!(debug_assertions) {
|
||||
actix_cors::Cors::permissive()
|
||||
|
@ -41,7 +49,3 @@ async fn main() -> std::io::Result<()> {
|
|||
.run()
|
||||
.await
|
||||
}
|
||||
|
||||
async fn index() -> impl Responder {
|
||||
HttpResponse::Ok().body("API Test Response")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue