fix error cannot get

This commit is contained in:
Guillaume Dorce 2022-11-03 18:45:28 +01:00
parent 28c1832001
commit 39b9f05cff
1 changed files with 4 additions and 2 deletions

View File

@ -48,9 +48,11 @@ app.use('/api', api);
const staticDist = fs.existsSync(path.join(__dirname, '../client/dist-vite')) ? express.static(path.join(__dirname, '../client/dist-vite')) : express.static(path.join(__dirname, '../client/dist'));
// app.use(staticDist);
app.use(staticDist);
app.get('/', staticDist);
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../client/dist/index.html'));
});
app.listen(port, () => {
console.log(`Server listening on port ${port}`);