1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-21 02:08:12 +09:00
This commit is contained in:
2020-07-19 13:39:15 +09:00
parent 536821d055
commit 96c2c70e28
8 changed files with 37 additions and 41 deletions

View File

@@ -1,11 +1,11 @@
import {send, sendError, fetch} from '../../../util/http';
import {NowRequest, NowResponse} from '@vercel/node';
import { NowRequest, NowResponse } from '@vercel/node';
import { fetch, send, sendError } from '../../../util/http';
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'));
@@ -21,7 +21,7 @@ export default async function handler(
'GET',
).then((res) => res.json());
const availability = response.valid;
send(res, {availability});
send(res, { availability });
} catch (err) {
sendError(res, err);
}