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