Closed thomasmorice-zz closed 5 years ago
GitHub issues aren't the right place for support questions like this. Please ask on StackOverflow or in our Discord chat room.
@thomasmorice note that you can use Netlify Dev for netlify stuff https://github.com/netlify/cli/blob/master/docs/netlify-dev.md to do what you needed there
@thomasmorice did you ever figure out how to do this?
I've used http-proxy-middleware
to proxy calls to another server
Do you have an example repo to share? I'm using the rollup template and I've tried http-proxy-middleware
and it's still not working
Here's my server.js:
polka()
.use('/api', createProxyMiddleware({ target: host, changeOrigin: true }))
.use(
compression({ threshold: 0 }),
sirv('static', { dev }),
app
)
.listen(PORT, err => {
if (err) console.log('error', err);
});
I'm not using it for netlify, but to send API calls to another server
Hello, I'm having hard time configuring a proxy for my local dev environment. I'm developing a lambda function (netlify) in parralel of my app (localhost:9000/.netlify/functions/hello) and these functions needs to be proxies in my sapper environment (localhost:3000/.netlify/functions/hello) I see no way of doing it easily through rollup or polka.. I guess this is where it is supposed to sit.. anyone has done it before maybe ?
Many thanks