whois/server/api/whois.post.ts
2024-03-25 06:55:06 +08:00

12 lines
260 B
TypeScript

import {whois} from "~/server/whois/whois";
export default defineEventHandler(async (event) => {
const body = await readBody(event)
try {
const res = await whois(body.domain)
return res._raw
} catch (e) {
return e
}
})