fixed compilation errors

This commit is contained in:
2026-01-28 12:47:02 +01:00
parent e2a3f1a149
commit 25beef5cca
4 changed files with 19 additions and 11 deletions

View File

@@ -1,12 +1,20 @@
use actix_web::{web, App, HttpRequest, HttpServer, Responder};
include!("handlers/locations.rs");
async fn index() -> impl Responder { "Connection successful" }
async fn index(req: HttpRequest) -> impl Responder { "Connection successful" }
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.service(web::resource("/").to(index))
.route("/", web::get().to(index))
.service(
web::scope("/api/v1")
.service(web::resource("/locations").to(|| {
get_locations()
}))
.service(web::resource("/locations").route(web::post().to(create_location)))
)
})
.bind("127.0.0.1:8080")?
.run()