score:3

Accepted answer
if (process.env.NODE_ENV === "production") {
  app.use(express.static("client/build"));
  const path = require("path");
  app.get("*", (req, res) => {
    res.sendFile(path.resolve(__dirname, "client", "build", "index.html"));
  });
}

score:0

http://localhost:server-port/client .

score:2

httdocs //root directory of your webserver
  |
  |-static
  |
  |-index.html
  |-serviceworker.js

Related Query

More Query from same tag