mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-06 02:00:46 +00:00
Add CORS allow list
This commit is contained in:
1 parent
450c4ebe0a
commit
d4b1fa93b1
1 file changed
+12
-1
+12
-1
@@ -99,9 +99,20 @@ async fn main() -> std::io::Result<()> {
|
||||
|
||||
HttpServer::new(move || App::new()
|
||||
.wrap(Logger::default())
|
||||
.wrap(
|
||||
Cors::new()
|
||||
.allowed_origin("http://localhost:12345")
|
||||
.allowed_origin("http://localhost:8080")
|
||||
.allowed_origin("http://trumped.com")
|
||||
.allowed_origin("http://jungle.horse")
|
||||
.allowed_methods(vec!["GET", "POST"])
|
||||
//.allowed_headers(vec![http::header::AUTHORIZATION, http::header::ACCEPT])
|
||||
//.allowed_header(http::header::CONTENT_TYPE)
|
||||
.max_age(3600)
|
||||
.finish())
|
||||
.service(Files::new("/frontend", asset_directory.clone()).show_files_listing())
|
||||
.service(
|
||||
web::resource("/tts")
|
||||
web::resource("/advanced_tts")
|
||||
.route(web::post().to(post_tts))
|
||||
.route(web::head().to(|| HttpResponse::Ok()))
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user