Merge branch 'dev'
This commit is contained in:
@@ -99,7 +99,16 @@ export async function bootstrap() {
|
|||||||
})
|
})
|
||||||
ctx.body = { success: true, message: output.trim() }
|
ctx.body = { success: true, message: output.trim() }
|
||||||
// Restart the server after response is sent
|
// 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) {
|
} catch (err: any) {
|
||||||
ctx.status = 500
|
ctx.status = 500
|
||||||
ctx.body = { success: false, message: err.stderr || err.message }
|
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)
|
// Skip non-API paths (static files, health check, SPA)
|
||||||
const path = ctx.path
|
const path = ctx.path.toLowerCase()
|
||||||
if (
|
if (
|
||||||
path === '/health' ||
|
path === '/health' ||
|
||||||
(!path.startsWith('/api') && !path.startsWith('/v1') && path !== '/webhook')
|
(!path.startsWith('/api') && !path.startsWith('/v1') && path !== '/webhook')
|
||||||
|
|||||||
Reference in New Issue
Block a user