Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
192 views
in Technique[技术] by (71.8m points)

node.js - Running a proxy on localhost for development

I have a front and backend running on localhost:3000 and localhost:80 respectively. Both are node.js fastify servers. Recently I went through a big headache getting CORS to work for setting cookies. But, never satisfied, I'd rather eliminate the need for CORS at all, especially because my production app does not need it.

Is it possible to somehow run some kind of proxy server or other mechanism where I could simply send requests from my frontend to api.localhost/somerequest or something like that instead of localhost:80/somerequest but magically have it find its way there?

I'm looking at ngix but don't even know where to start.. especially since my servers are already running on Node and I don't understand how it would integrate with ngix.

question from:https://stackoverflow.com/questions/66056375/running-a-proxy-on-localhost-for-development

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...