yes
This commit is contained in:
@@ -16,6 +16,8 @@ async fn api_ticket(id: web::Path<i32>) -> impl Responder {
|
||||
//return struct values as string
|
||||
HttpResponse::Ok()
|
||||
.content_type(ContentType::plaintext())
|
||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||
.insert_header(("content-type", "text/plain"))
|
||||
.body(format!(
|
||||
"Ticket ID: {}, Ticket Price: {}, Ticket Status: {}",
|
||||
fetched_ticket_data.id, fetched_ticket_data.category, fetched_ticket_data.description
|
||||
@@ -29,6 +31,8 @@ async fn api_admin(id: web::Path<i32>) -> impl Responder {
|
||||
//return struct values as string
|
||||
HttpResponse::Ok()
|
||||
.content_type(ContentType::plaintext())
|
||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||
.insert_header(("content-type", "text/plain"))
|
||||
.body(format!(
|
||||
"Admin ID: {}, Admin Name: {}, Admin Email: {}",
|
||||
fetched_admin_data.id, fetched_admin_data.name, fetched_admin_data.address
|
||||
@@ -42,6 +46,7 @@ async fn api_driver(id: web::Path<i32>) -> impl Responder {
|
||||
.content_type(ContentType::plaintext())
|
||||
//headers for plain text
|
||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||
.insert_header(("content-type", "text/plain"))
|
||||
.body(format!(
|
||||
"Driver ID: {}, Driver Name: {}, Driver Email: {}",
|
||||
fetched_driver_data.id, fetched_driver_data.name, fetched_driver_data.address
|
||||
@@ -51,5 +56,7 @@ async fn api_driver(id: web::Path<i32>) -> impl Responder {
|
||||
async fn api_test() -> impl Responder {
|
||||
HttpResponse::Ok()
|
||||
.content_type(ContentType::plaintext())
|
||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||
.insert_header(("content-type", "text/plain"))
|
||||
.body("My balls are on fire :(")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user