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
Unable to add Express REST API #24
Comments
this is due to the order of the middleware and WebpackDevServer having historyAPiFallback |
I updated the server stub and turned off |
@gdi2290 Thanks Patrick. I tried it and it worked well. I have just one more question, how to run the express server along with the build and watch processes? I tried it with the following script in NPM, but it stops at express and doesn't run watch: "myServer": "npm install && npm run build && npm run express && npm run watch" Is there a way to run both of them together? |
@sravikiran the stub is rebuilding in development but you have to reload manually express-server-example.js#L97 until I correctly inject the webpack socketio stuff. I would delete the build folder and run |
@gdi2290 Thanks again for the response. That makes sense. |
Hi,
I just started playing with this starter kit. I ran the sample using the following command to make use of the express-server-example.js file:
node server/express-server-example
It starts the server on the port 8080 and I am able to browse the sample. Then I added the following REST endpoint to the file express-server-example.js:
app.get('/api/sample', function(request, response) {
response.send({name:"Ravi"});
});
Now when I hit this endpoint, I get the following view instead of getting JSON response from the endpoint:
I tried to fix this and ended with no luck as of now. Is this a bug in the starter kit? Otherwise, can someone help me in resolving this?
The text was updated successfully, but these errors were encountered: