File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ pub async fn is_alive() -> impl IntoResponse {
1313 let docker = get_docker_client ( ) ;
1414
1515 match docker {
16- Ok ( _) => ( StatusCode :: OK , Json ( json ! ( { "message " : "Docker is alive" } ) ) ) . into_response ( ) ,
17- Err ( error) => error. into_response ( )
16+ Ok ( _) => ( StatusCode :: OK , Json ( json ! ( { "status " : 1 } ) ) ) . into_response ( ) ,
17+ Err ( error) => ( StatusCode :: INTERNAL_SERVER_ERROR , Json ( json ! ( { " error" : error . message , "status" : 0 } ) ) ) . into_response ( )
1818 }
1919}
2020
Original file line number Diff line number Diff line change @@ -2,15 +2,18 @@ mod routes;
22mod controllers;
33mod errors;
44
5- use axum:: http:: Method ;
5+ use axum:: http:: { HeaderValue , Method } ;
66use routes:: setup_routes;
77use tower_http:: cors:: { AllowOrigin , CorsLayer } ;
88
99#[ tokio:: main]
1010async fn main ( ) {
1111 let cors = CorsLayer :: new ( )
1212 . allow_methods ( vec ! [ Method :: GET , Method :: POST , Method :: PUT , Method :: DELETE ] )
13- . allow_origin ( AllowOrigin :: exact ( "http://localhost:5173" . parse ( ) . unwrap ( ) ) ) ;
13+ . allow_origin ( AllowOrigin :: list ( [
14+ HeaderValue :: from_str ( "https://admin.bryan-ferrando.fr" ) . unwrap ( ) ,
15+ HeaderValue :: from_str ( "http://localhost:5173" ) . unwrap ( )
16+ ] ) ) ;
1417
1518 let app = setup_routes ( ) . layer ( cors) ;
1619
You can’t perform that action at this time.
0 commit comments