Fix Express 5 SPA fallback route
This commit is contained in:
@@ -47,7 +47,7 @@ app.put('/api/admin-content', async (req, res) => {
|
|||||||
|
|
||||||
app.use(express.static(DIST_DIR))
|
app.use(express.static(DIST_DIR))
|
||||||
|
|
||||||
app.get('*', async (_req, res) => {
|
app.use(async (_req, res) => {
|
||||||
try {
|
try {
|
||||||
const html = await readFile(INDEX_FILE, 'utf8')
|
const html = await readFile(INDEX_FILE, 'utf8')
|
||||||
res.type('html').send(html)
|
res.type('html').send(html)
|
||||||
|
|||||||
Reference in New Issue
Block a user