1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 09:58:13 +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,5 +1,5 @@
import nodeFetch, {Response} from 'node-fetch';
import {NowResponse} from '@vercel/node';
import { NowResponse } from '@vercel/node';
import nodeFetch, { Response } from 'node-fetch';
export type HttpMethod =
| 'GET'
@@ -15,7 +15,7 @@ export function fetch(
url: string,
method: HttpMethod = 'HEAD',
): Promise<Response> {
return nodeFetch(url, {method: method});
return nodeFetch(url, { method: method });
}
export function send(res: NowResponse, data: object): void {
@@ -24,5 +24,5 @@ export function send(res: NowResponse, data: object): void {
}
export function sendError(res: NowResponse, error: Error): void {
res.status(400).json({error: error.message});
res.status(400).json({ error: error.message });
}