Cors allow anywhere in debug

This commit is contained in:
Imbus 2024-02-27 03:47:50 +01:00
parent fae97efc2d
commit 62f3e0d72f

View file

@ -42,9 +42,9 @@ async fn main() -> std::io::Result<()> {
.allowed_methods(vec!["GET", "POST"])
.max_age(3600);
// In debug mode, allow localhost
// In debug mode, allow any origin
#[cfg(debug_assertions)]
let cors = cors.allowed_origin("http://localhost:8080");
let cors = cors.allow_any_origin();
App::new()
.wrap(cors)