Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CORS on the proxy #13

Open
samuelnovaes opened this issue Apr 19, 2021 · 1 comment
Open

Enable CORS on the proxy #13

samuelnovaes opened this issue Apr 19, 2021 · 1 comment

Comments

@samuelnovaes
Copy link

My Express app has CORS enabled, but it doesn't work becouse the proxy doesn't have the CORS enabled.

@ilesmana
Copy link

ilesmana commented Aug 1, 2021

Hi @samuelnovaes ,
maybe you can follow my approach:
add "Access-Control-Allow-Origin": "", and "Access-Control-Allow-Methods": "" to proxy.ts

update proxy.ts to this, build & run:

const httpServer = http.createServer((req, res) => { res.writeHead(301, { "Location": "https://" + req.headers['host']! + req.url, "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "*" }); res.end(); });

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

No branches or pull requests

2 participants