From ca18e18b5a83a1420bea284e693d899219fddcd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20L=C3=B3pez-Doriga?= Date: Tue, 17 Oct 2023 13:34:14 +0200 Subject: [PATCH] allowing frontend --- beacon/__main__.py | 7 ++++++- deploy/docker-compose.yml | 2 +- frontend/src/config.json | 4 ++-- frontend/src/index.js | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/beacon/__main__.py b/beacon/__main__.py index 5249f6f3..9d733cd3 100644 --- a/beacon/__main__.py +++ b/beacon/__main__.py @@ -62,7 +62,7 @@ def main(path=None): #) beacon = web.Application( - middlewares=[web.normalize_path_middleware(), middlewares.error_middleware, cors_middleware(origins=["https://beacon-network-test.ega-archive.org", "https://beacon-network-test2.ega-archive.org", "https://beacon-network-demo.ega-archive.org","https://beacon-network-demo2.ega-archive.org", "http://localhost:3000", "https://beacon-network-cineca-demo.ega-archive.org"])] + middlewares=[web.normalize_path_middleware(), middlewares.error_middleware, cors_middleware(origins=["https://beacon-network-test.ega-archive.org", "https://beacon-network-test2.ega-archive.org", "https://beacon-network-demo.ega-archive.org","https://beacon-network-demo2.ega-archive.org", "http://localhost:3000", "http://localhost:3010", "https://beacon-network-cineca-demo.ega-archive.org"])] ) @@ -107,6 +107,11 @@ def main(path=None): expose_headers="*", allow_methods=("POST", "PATCH", "GET", "OPTIONS"), allow_headers=DEFAULT_ALLOW_HEADERS), + "http://localhost:3010": + aiohttp_cors.ResourceOptions(allow_credentials=True, + expose_headers="*", + allow_methods=("POST", "PATCH", "GET", "OPTIONS"), + allow_headers=DEFAULT_ALLOW_HEADERS), "https://beacon-network-test2.ega-archive.org": aiohttp_cors.ResourceOptions(allow_credentials=True, expose_headers="*", diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 71c82a42..55a2642c 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -173,7 +173,7 @@ services: command: ["node", "/opt/yarn-v1.22.19/bin/yarn.js", "start" ] container_name: react ports: - - 3010:3000 + - 3000:3000 volumes: - ../frontend:/usr/src/app diff --git a/frontend/src/config.json b/frontend/src/config.json index ba02e53d..0f3cfb82 100644 --- a/frontend/src/config.json +++ b/frontend/src/config.json @@ -1,7 +1,7 @@ { - "API_URL": "localhost:5050/api", + "API_URL": "http://localhost:5050/api", "REDIRECT_URL": "please insert here your redirect URL", - "KEYCLOAK_URL": "https://beacon-network-demo2.ega-archive.org" + "KEYCLOAK_URL": "http://localhost:8080" } \ No newline at end of file diff --git a/frontend/src/index.js b/frontend/src/index.js index 9136baf8..b68b4921 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -25,7 +25,7 @@ const oidcConfig = { automaticSilentRenew: true, redirectUri: process.env.NODE_ENV === 'development' - && 'https://beacon-network-demo.ega-archive.org/', + && 'http://localhost:3000/', scope: 'openid profile email ga4gh_passport_v1 offline_access', revokeAccessTokenOnSignout: true };