| 72 | } |
| 73 | |
| 74 | fn cors() -> Cors { |
| 75 | let allowed_origins = |
| 76 | AllowedOrigins::some_exact(&["http://localhost:8000", "http://127.0.0.1:8000"]); |
| 77 | |
| 78 | rocket_cors::CorsOptions { |
| 79 | allowed_origins, |
| 80 | allowed_methods: vec![Method::Get, Method::Post, Method::Delete] |
| 81 | .into_iter() |
| 82 | .map(From::from) |
| 83 | .collect(), |
| 84 | allowed_headers: AllowedHeaders::all(), |
| 85 | allow_credentials: true, |
| 86 | ..Default::default() |
| 87 | } |
| 88 | .to_cors() |
| 89 | .unwrap() |
| 90 | } |
| 91 | |
| 92 | fn custom_openapi_spec() -> OpenApi { |
| 93 | use rocket_okapi::okapi::openapi3::*; |