Fix sub-store SPA fallback

This commit is contained in:
xishang0128
2025-12-15 01:36:18 +08:00
committed by zjdndjf
parent e336b3c88d
commit 12b49e49e4

View File

@@ -78,7 +78,11 @@ export async function startSubStoreFrontendServer(): Promise<void> {
await stopSubStoreFrontendServer()
subStoreFrontendPort = await findAvailablePort(14122)
const app = express()
app.use(express.static(path.join(mihomoWorkDir(), 'sub-store-frontend')))
const frontendDir = path.join(mihomoWorkDir(), 'sub-store-frontend')
app.use(express.static(frontendDir))
app.use((_req, res) => {
res.sendFile(path.join(frontendDir, 'index.html'))
})
subStoreFrontendServer = app.listen(subStoreFrontendPort, subStoreHost)
}