add cors?
This commit is contained in:
parent
1c56bcb107
commit
d8a9058153
1 changed files with 5 additions and 1 deletions
|
@ -49,7 +49,11 @@ async fn main() -> std::io::Result<()> {
|
||||||
log::info!("starting HTTP server at http://localhost:4242");
|
log::info!("starting HTTP server at http://localhost:4242");
|
||||||
|
|
||||||
HttpServer::new(|| {
|
HttpServer::new(|| {
|
||||||
let cors = Cors::permissive();
|
let mut cors = Cors::default()
|
||||||
|
.allow_any_origin()
|
||||||
|
.allow_any_method()
|
||||||
|
.allow_any_header()
|
||||||
|
.max_age(3600);
|
||||||
|
|
||||||
App::new()
|
App::new()
|
||||||
.wrap(middleware::Logger::default())
|
.wrap(middleware::Logger::default())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue