elk/server/api/[server]/clear.ts

14 lines
339 B
TypeScript
Raw Normal View History

2023-01-15 12:34:17 +03:00
import { deleteApp } from '~~/server/shared'
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 }
})