MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / cors

Function cors

examples/rocket_okapi_example/api/src/lib.rs:74–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72}
73
74fn 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
92fn custom_openapi_spec() -> OpenApi {
93 use rocket_okapi::okapi::openapi3::*;

Callers 1

startFunction · 0.85

Calls 2

unwrapMethod · 0.80
into_iterMethod · 0.80

Tested by

no test coverage detected