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-20 00:57:33 +09:00
parent a31c13e725
commit c7bbe707a9
71 changed files with 1074 additions and 1089 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,
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)
}
}