backend: remove unused imports

This commit is contained in:
Sphereso 2024-07-05 16:10:03 +02:00
parent 2f136fbb01
commit 4a9fba6d0e

View file

@ -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")
}