Compare commits

...

2 Commits

Author SHA1 Message Date
CrescentLeaf
58f0427350 去你妈的不区分大小写 2025-12-07 00:47:40 +08:00
CrescentLeaf
e3db26323b 客户端路由不会同步到服务端路由 2025-12-07 00:47:15 +08:00
2 changed files with 11 additions and 0 deletions

View File

@@ -33,6 +33,17 @@ export default async function createLingChairServer() {
res.sendFile(path.resolve(file!.getFilePath()))
file.updateLastUsedTime()
})
// For client-side router
app.get(/.*/, (req, res, next) => {
if (
req.path.startsWith('/uploaded_files/')
|| req.path === '/config.json'
) {
return next()
}
res.sendFile(path.resolve(config.data_path + '/page_compiled/index.html'))
})
await fs.mkdir(config.data_path + '/upload_cache', { recursive: true })
try {