Fix: Always serve React build regardless of NODE_ENV
This commit is contained in:
1 parent
3c947ef6a3
commit
7214238f33
1 file changed
+1
-3
+1
-3
@@ -364,13 +364,11 @@ app.post('/api/test-webhook', async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Serve React app in production
|
// Serve React app
|
||||||
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.get('*', (req, res) => {
|
app.get('*', (req, res) => {
|
||||||
res.sendFile(path.join(__dirname, '../client/build/index.html'));
|
res.sendFile(path.join(__dirname, '../client/build/index.html'));
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, () => {
|
||||||
|
|||||||
Reference in new issue
Block a user