mirror of
https://github.com/EKKOLearnAI/hermes-web-ui.git
synced 2026-05-26 22:10:15 +00:00
Merge branch 'dev'
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user