Skip to content

Commit

Permalink
[#224] Enable CORS for localhost
Browse files Browse the repository at this point in the history
This is a pre-step before implementing an exception that will be applied
only to dev environment. This update facilitates easier development and
testing by allowing local frontend applications to communicate with the
backend without CORS restrictions.

For development purposes, Cross-Origin Resource Sharing (CORS) settings
have been updated to include `localhost` in the list of allowed origins.
In next step the configuration for different environments will be stated
explicite in target docjer-compose file.
  • Loading branch information
placek authored and MSzalowski committed Feb 23, 2024
1 parent f3ad106 commit 025d73f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/govtool/docker-compose.sanchonet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}`) && PathPrefix(`/api`)"
- "traefik.http.middlewares.backend-stripprefix.stripprefix.prefixes=/api"
- "traefik.http.middlewares.backend-cors.headers.customresponseheaders.Access-Control-Allow-Origin=https://${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network}"
- "traefik.http.middlewares.backend-cors.headers.customresponseheaders.Access-Control-Allow-Methods=GET,HEAD,OPTIONS"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolallowmethods=GET,HEAD,OPTIONS"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolallowheaders=*"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolalloworiginlist=https://${DOMAIN:-$ENVIRONMENT-$CARDANO_NETWORK.govtool.byron.network},http://localhost"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolmaxage=100"
- "traefik.http.middlewares.backend-cors.headers.addvaryheader=true"
- "traefik.http.routers.backend.middlewares=backend-stripprefix@docker,backend-cors@docker"
- "traefik.http.routers.backend.entrypoints=websecure"
Expand Down

0 comments on commit 025d73f

Please sign in to comment.