|
@@ -22,7 +22,9 @@ app.use('/api/guess', createGuessRouter(wordBank));
|
|
|
app.use('/api/play-again', createPlayAgainRouter(wordBank));
|
|
app.use('/api/play-again', createPlayAgainRouter(wordBank));
|
|
|
|
|
|
|
|
// Serve SPA in production
|
|
// Serve SPA in production
|
|
|
-const clientDist = resolve(__dirname, '../../client/dist');
|
|
|
|
|
|
|
+const clientDist = process.env.STATIC_DIR
|
|
|
|
|
+ ? resolve(process.env.STATIC_DIR)
|
|
|
|
|
+ : resolve(__dirname, '../../client/dist');
|
|
|
app.use(express.static(clientDist));
|
|
app.use(express.static(clientDist));
|
|
|
app.get('/{*path}', (_req, res) => {
|
|
app.get('/{*path}', (_req, res) => {
|
|
|
res.sendFile(resolve(clientDist, 'index.html'));
|
|
res.sendFile(resolve(clientDist, 'index.html'));
|