add cors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kasper Juul Hermansen 2022-07-18 14:04:13 +02:00
parent 5aecf1ef26
commit 86cc2ea889
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912

View File

@ -54,9 +54,14 @@ impl Server {
.data(app) .data(app)
.finish(); .finish();
let cors = vec!["http://localhost:3000" let cors = vec![
"http://localhost:3000"
.parse() .parse()
.expect("Could not parse url")]; .expect("Could not parse url"),
"https://scel.front.kjuulh.io"
.parse()
.expect("Could not parse url"),
];
let app = Router::new() let app = Router::new()
.route("/", routing::get(graphql_playground).post(graphql_handler)) .route("/", routing::get(graphql_playground).post(graphql_handler))