1
0
mirror of https://github.com/elk-zone/elk synced 2024-12-03 17:28:11 +09:00
elk/server/api/[server]/clear.ts

12 lines
293 B
TypeScript
Raw Normal View History

2023-01-15 18:34:17 +09:00
export default defineEventHandler(async (event) => {
const { server } = getRouterParams(event)
const { key } = getQuery(event)
if (key !== String(useRuntimeConfig().adminKey))
return { status: false, error: 'incorrect key' }
await deleteApp(server)
return { status: true }
})