Skip to content

Commit 4fd12e1

Browse files
committed
debug path
1 parent 2f129ea commit 4fd12e1

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

server/server.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -520,34 +520,36 @@ app.get(
520520
);
521521

522522
// serve index.html on the route '/'
523-
const isDocker = process.env.IS_DOCKER === 'true';
524-
console.log('this is running on docker: ', isDocker);
523+
// const isDocker = process.env.IS_DOCKER === 'true';
524+
// console.log('this is running on docker: ', isDocker);
525525

526526
//if in production mode, statically serve everything in the build folder on the route '/dist'
527527
if (process.env.NODE_ENV == 'production') {
528+
console.log('in production');
529+
console.log('dirname: ', __dirname);
528530
app.use('/', express.static(path.join(__dirname, '/build')));
531+
} else {
532+
console.log('not production');
533+
console.log('dirname: ', __dirname);
534+
app.get('/', (req, res) => {
535+
const indexPath = path.join(__dirname, '../index.html');
536+
return res.status(200).sendFile(indexPath);
537+
});
529538
}
530539

531-
app.get('/', (req, res) => {
532-
const indexPath = isDocker
533-
? path.join(__dirname, '../index-prod.html')
534-
: path.join(__dirname, '../index.html');
535-
return res.status(200).sendFile(indexPath);
536-
});
537-
538540
// app.get('/bundle.js', (req, res) => {
539541
// return res.status(200).sendFile(path.join(process.cwd(), 'bundle.js'));
540542
// });
541543

542-
if (isDocker) {
543-
app.get('/main.css', (req, res) => {
544-
return res.status(200).sendFile(path.join(process.cwd(), 'main.css'));
545-
});
546-
}
544+
// if (isDocker) {
545+
// app.get('/main.css', (req, res) => {
546+
// return res.status(200).sendFile(path.join(process.cwd(), 'main.css'));
547+
// });
548+
// }
547549

548-
app.get('/test', (req, res) => {
549-
res.send('test request is working');
550-
});
550+
// app.get('/test', (req, res) => {
551+
// res.send('test request is working');
552+
// });
551553

552554
app.use('/*', (req, res) => res.status(404).send('Page not found'));
553555

0 commit comments

Comments
 (0)