added test api function that just returns a string thank you obama

This commit is contained in:
LinlyBoi
2022-12-24 21:29:20 +02:00
parent d012926261
commit 87d96d938f
6 changed files with 724 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
use actix_web::{
get,
web::{self, Json},
App, HttpServer,
App, HttpResponse, HttpServer, Responder,
};
use backend::{
admin_data::get_admin, driver_data::get_driver, establish_connection, ticket_data::get_ticket,
@@ -37,6 +37,10 @@ async fn api_driver(id: web::Path<i32>) -> Json<CommonDriver> {
let fetched_driver_data = get_driver(&mut establish_connection(), *id);
Json(fetched_driver_data)
}
#[get("api/test")]
async fn api_test() -> impl Responder {
HttpResponse::Ok().body("My balls are on fire :(")
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
@@ -45,6 +49,7 @@ async fn main() -> std::io::Result<()> {
.service(api_ticket)
.service(api_admin)
.service(api_driver)
.service(api_test)
})
.bind(("0.0.0.0", 48590))?
.run()