Back
When I tried to run the npm build command it gives the following error:
You need to enable JavaScript to run this app
Can anyone help me with this?
You can try the below command, this will help you to run the app:
"homepage": "."
For index.js:
app.use(express.static(__dirname)); //here is important thing - no static directory, because all static :)app.get("/*", function(req, res) { res.sendFile(path.join(__dirname, "index.html"));});
app.use(express.static(__dirname)); //here is important thing - no static directory, because all static :)
app.get("/*", function(req, res) {
res.sendFile(path.join(__dirname, "index.html"));
});
I hope this will help.
Want to know more about Java? Prefer this tutorial on Java Tutorial.
Want to become a Java expert? join Java Certification now!!
31k questions
32.8k answers
501 comments
693 users