Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
🐛 fix(server): serve static assets correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
k99k5 committed Feb 24, 2024
1 parent 23147dd commit c72ce19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server-production.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import express from 'express';

const app = express();

app.use('/', express.static(path.join('./../client')));
const assets = express.static(path.join('./../client'));
app.use('/', async (req, res, next) => {
if (req.url.endsWith('/')) {
return next();
}
return assets(req, res, next);
});

app.get('*', async (req, res) => {
try {
Expand Down

0 comments on commit c72ce19

Please sign in to comment.