File tree Expand file tree Collapse file tree 2 files changed +3
-26
lines changed Expand file tree Collapse file tree 2 files changed +3
-26
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -45,9 +45,8 @@ use actix_cors::Cors;
4545#[ actix_rt:: main]
4646async fn main ( ) -> io:: Result < ( ) > {
4747 dotenv:: dotenv ( ) . expect ( "Failed to read .env file" ) ;
48- // env::set_var("RUST_LOG", "actix_web=debug");
49- // env_logger::init();
50- let _handle = log4rs:: init_file ( "log4rs.yaml" , Default :: default ( ) ) . unwrap ( ) ;
48+ env:: set_var ( "RUST_LOG" , "actix_web=debug" ) ;
49+ env_logger:: init ( ) ;
5150
5251 let app_host = env:: var ( "APP_HOST" ) . expect ( "APP_HOST not found." ) ;
5352 let app_port = env:: var ( "APP_PORT" ) . expect ( "APP_PORT not found." ) ;
@@ -58,7 +57,7 @@ async fn main() -> io::Result<()> {
5857
5958 HttpServer :: new ( move || {
6059 App :: new ( )
61- . wrap ( Cors :: new ( ) // run order : **2**
60+ . wrap ( Cors :: new ( ) // allowed_origin return access-control-allow-origin : * by default
6261 // .allowed_origin("http://127.0.0.1:8080")
6362 . send_wildcard ( )
6463 . allowed_methods ( vec ! [ "GET" , "POST" , "PUT" , "DELETE" ] )
You can’t perform that action at this time.
0 commit comments