-
Notifications
You must be signed in to change notification settings - Fork 759
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
Package.json proxy configuration expected to work? #380
Comments
Could you give me an example of what you're trying to do? |
In a click handler on a button
package.json
|
Just trying to recreate https://github.com/netlify/create-react-app-lambda in my existing react-static project. |
Try this in your static.config.js: export default {
...
devServer: {
proxy: {
"/.netlify/functions": {
"target": "http://localhost:9000",
"pathRewrite": {
"^/\\.netlify/functions": ""
}
}
}
},
} |
Success! Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use the proxy setting to redirect fetch and axios calls locally to a dev server with my API calls but it doesn't seem to be taking in my react-static project. Would a call to fetch not in the static.config.js file be expected to accept this proxy setting? Proxying is working with a basic create-react-app, just not in my react-static project.
The text was updated successfully, but these errors were encountered: