Skip to content

Commit 8ae06d6

Browse files
committed
remote log4rs
1 parent 8e948b3 commit 8ae06d6

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

log4rs.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ use actix_cors::Cors;
4545
#[actix_rt::main]
4646
async 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"])

0 commit comments

Comments
 (0)