mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/mihomo-party-org/clash-party.git
synced 2026-09-20 08:03:39 +08:00
Fix sub-store SPA fallback
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user