added test api function that just returns a string thank you obama
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user