1
0
mirror of https://github.com/uetchy/namae.git synced 2025-10-14 23:22:19 +09:00

style: prettier

This commit is contained in:
2020-08-31 08:41:53 +09:00
committed by uetchy
parent 9278b7a2ee
commit f5f7b51fcb
73 changed files with 1014 additions and 5220 deletions

View File

@@ -1,22 +1,22 @@
import whois from 'whois-json'
import { send, sendError } from '../../../util/http'
import { NowRequest, NowResponse } from '@vercel/node'
import whois from 'whois-json';
import { send, sendError } from '../../../util/http';
import { NowRequest, NowResponse } from '@vercel/node';
export default async function handler(
req: NowRequest,
res: NowResponse
): Promise<void> {
const { query } = req.query
const { query } = req.query;
if (!query || typeof query !== 'string') {
return sendError(res, new Error('No query given'))
return sendError(res, new Error('No query given'));
}
try {
const response = await whois(query, { follow: 3, verbose: true })
const availability = response[0].data.domainName ? false : true
send(res, { availability })
const response = await whois(query, { follow: 3, verbose: true });
const availability = response[0].data.domainName ? false : true;
send(res, { availability });
} catch (err) {
sendError(res, err)
sendError(res, err);
}
}