??
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -3,10 +3,12 @@ use actix_web::{
|
|||||||
web::{self, Json},
|
web::{self, Json},
|
||||||
App, HttpServer,
|
App, HttpServer,
|
||||||
};
|
};
|
||||||
use backend::{establish_connection, admin_data::get_admin, ticket_data::get_ticket, driver_data::get_driver};
|
use backend::{
|
||||||
|
admin_data::get_admin, driver_data::get_driver, establish_connection, ticket_data::get_ticket,
|
||||||
|
};
|
||||||
use common::CommonAdmin;
|
use common::CommonAdmin;
|
||||||
use common::CommonTicket;
|
|
||||||
use common::CommonDriver;
|
use common::CommonDriver;
|
||||||
|
use common::CommonTicket;
|
||||||
|
|
||||||
// //Admin Services
|
// //Admin Services
|
||||||
// #[get("/api/admin/{id}")]
|
// #[get("/api/admin/{id}")]
|
||||||
@@ -40,7 +42,12 @@ async fn api_driver(id: web::Path<i32>) -> Json<CommonDriver> {
|
|||||||
|
|
||||||
#[actix_web::main]
|
#[actix_web::main]
|
||||||
async fn main() -> std::io::Result<()> {
|
async fn main() -> std::io::Result<()> {
|
||||||
HttpServer::new(|| App::new().service(api_ticket).service(api_admin).service(api_driver))
|
HttpServer::new(|| {
|
||||||
|
App::new()
|
||||||
|
.service(api_ticket)
|
||||||
|
.service(api_admin)
|
||||||
|
.service(api_driver)
|
||||||
|
})
|
||||||
.bind(("0.0.0.0", 48590))?
|
.bind(("0.0.0.0", 48590))?
|
||||||
.run()
|
.run()
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user