Merge branch 'dev'

This commit is contained in:
ekko
2026-04-20 15:22:05 +08:00
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -99,7 +99,16 @@ export async function bootstrap() {
})
ctx.body = { success: true, message: output.trim() }
// Restart the server after response is sent
setTimeout(() => process.exit(0), 1000)
setTimeout(() => {
const { spawn } = require('child_process')
const isWin = process.platform === 'win32'
spawn(isWin ? 'cmd' : 'sh', isWin ? ['/c', 'hermes-web-ui restart'] : ['-c', 'hermes-web-ui restart'], {
detached: true,
stdio: 'ignore',
windowsHide: true,
}).unref()
process.exit(0)
}, 2000)
} catch (err: any) {
ctx.status = 500
ctx.body = { success: false, message: err.stderr || err.message }
+1 -1
View File
@@ -48,7 +48,7 @@ export async function authMiddleware(token: string | null) {
}
// Skip non-API paths (static files, health check, SPA)
const path = ctx.path
const path = ctx.path.toLowerCase()
if (
path === '/health' ||
(!path.startsWith('/api') && !path.startsWith('/v1') && path !== '/webhook')