Remove Node serving files.

This commit is contained in:
Patrick Fic
2020-10-06 21:10:40 -07:00
parent 5f6cdf5bf8
commit b2c52fe782

View File

@@ -130,22 +130,22 @@ app.post("/qbo/authorize", qbo.authorize);
app.get("/qbo/callback", qbo.callback); app.get("/qbo/callback", qbo.callback);
//Serve React App if in Production //Serve React App if in Production
if (process.env.NODE_ENV === "production") { // if (process.env.NODE_ENV === "production") {
app.use(express.static(path.join(__dirname, "client/build"))); // app.use(express.static(path.join(__dirname, "client/build")));
app.use(express.static(path.join(__dirname, "admin/build"))); // app.use(express.static(path.join(__dirname, "admin/build")));
app.get("/service-worker.js", (req, res) => { // app.get("/service-worker.js", (req, res) => {
res.sendFile(path.resolve(__dirname, "client/build", "service-worker.js")); // res.sendFile(path.resolve(__dirname, "client/build", "service-worker.js"));
}); // });
app.get("/admin*", function (req, res) { // app.get("/admin*", function (req, res) {
res.sendFile(path.join(__dirname, "admin/build", "index.html")); // res.sendFile(path.join(__dirname, "admin/build", "index.html"));
}); // });
app.get("*", function (req, res) { // app.get("*", function (req, res) {
res.sendFile(path.join(__dirname, "client/build", "index.html")); // res.sendFile(path.join(__dirname, "client/build", "index.html"));
}); // });
} // }
if (process.env.NODE_ENV === "production") { if (process.env.NODE_ENV === "production") {
app.listen(port, (error) => { app.listen(port, (error) => {