update actix to use cors stuff
This commit is contained in:
parent
a5ba976abf
commit
1c56bcb107
4 changed files with 30 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
mod api;
|
||||
|
||||
use actix_cors::Cors;
|
||||
use actix_multipart::form::tempfile::TempFileConfig;
|
||||
use actix_web::{middleware, App, HttpServer};
|
||||
use api::camp_form::camp_form;
|
||||
|
@ -48,8 +49,11 @@ async fn main() -> std::io::Result<()> {
|
|||
log::info!("starting HTTP server at http://localhost:4242");
|
||||
|
||||
HttpServer::new(|| {
|
||||
let cors = Cors::permissive();
|
||||
|
||||
App::new()
|
||||
.wrap(middleware::Logger::default())
|
||||
.wrap(cors)
|
||||
.app_data(TempFileConfig::default().directory("./tmp"))
|
||||
.service(mt_form)
|
||||
.service(health_form)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue