add cors?

This commit is contained in:
Chris Cochrun 2024-07-05 21:08:23 -05:00
parent 1c56bcb107
commit d8a9058153

View file

@ -49,7 +49,11 @@ async fn main() -> std::io::Result<()> {
log::info!("starting HTTP server at http://localhost:4242");
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()
.wrap(middleware::Logger::default())