Public Access
fix: update route handling for static files to improve frontend serving
Release Pipeline / build-and-release (push) Successful in 5m36s
Release Pipeline / build-and-release (push) Successful in 5m36s
This commit is contained in:
1 parent
9539e3d740
commit
7b4288fe86
1 file changed
+1
-1
@@ -39,7 +39,7 @@ const frontendDistPath = path.join(__dirname, '../../frontend/dist')
|
|||||||
if (fs.existsSync(frontendDistPath)) {
|
if (fs.existsSync(frontendDistPath)) {
|
||||||
console.log(`Serving frontend from: ${frontendDistPath}`)
|
console.log(`Serving frontend from: ${frontendDistPath}`)
|
||||||
app.use(express.static(frontendDistPath))
|
app.use(express.static(frontendDistPath))
|
||||||
app.get('*', (req, res) => {
|
app.get('*path', (req, res) => {
|
||||||
if (!req.path.startsWith('/api')) {
|
if (!req.path.startsWith('/api')) {
|
||||||
res.sendFile(path.join(frontendDistPath, 'index.html'))
|
res.sendFile(path.join(frontendDistPath, 'index.html'))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user