Remove Node serving files.
This commit is contained in:
26
server.js
26
server.js
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user