You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flexibility to override the HTTP methods as the API may not support the user requested methods.
Actual behavior
Not able to override HTTP methods.
Setup
server: webpac-dev-server
I am using webpack-dev-server as a proxy to my original API URL to avoid CORS related issues and dynamically pointing to Dev, UAT, Mock server URL based on the environments.
For Mock dev - I prefer to use the JSON from the local file system and it servers its purpose for all the GET request.
One possible approach may be - Overriding the HTTP Request methods to GET as I am not passing any payload. But I can't find any configuration for that.
onProxyReq: function(proxyReq, req, res) {
// convert all api requests (POST/PUT/DELETE) to GET so they work in webpack dev server for mocking
proxyReq.method = 'GET';
}
Expected behavior
Flexibility to override the HTTP methods as the API may not support the user requested methods.
Actual behavior
Not able to override HTTP methods.
Setup
I am using webpack-dev-server as a proxy to my original API URL to avoid CORS related issues and dynamically pointing to Dev, UAT, Mock server URL based on the environments.
For Mock dev - I prefer to use the JSON from the local file system and it servers its purpose for all the GET request.
One possible approach may be - Overriding the HTTP Request methods to GET as I am not passing any payload. But I can't find any configuration for that.
http://stackoverflow.com/questions/42735457/webpack-dev-server-support-for-post-put-delete-methods-using-proxy
The text was updated successfully, but these errors were encountered: