Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Configure CORS policy to be accessed from the different host #9

Closed
scalalang2 opened this issue Sep 22, 2022 · 1 comment
Closed

Configure CORS policy to be accessed from the different host #9

scalalang2 opened this issue Sep 22, 2022 · 1 comment

Comments

@scalalang2
Copy link
Contributor

Background

API server is inherently designed as standalone server
It wouldn't contains any frontend sources

So, if frontend website is needed to access to our server
We must allow different host to access to the api server

Details

  • Add allowed_host to the config.toml
    • "*" means any website, if specific host is needed, then wite hostname like http://localhost:3000/
  • Write response with header Access-Control-Allow-Origin for each api handlers.
@scalalang2
Copy link
Contributor Author

resolved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant