1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-21 10:18:12 +09:00

chore: cosmetic changes

This commit is contained in:
2019-09-17 14:30:26 +09:00
parent 2438518e3c
commit 6c84493360
56 changed files with 724 additions and 729 deletions

View File

@@ -1,23 +1,23 @@
import { send, sendError, fetch, NowResponse, NowRequest } from '../util/http'
import {send, sendError, fetch, NowResponse, NowRequest} from '../util/http';
export default async function handler(req: NowRequest, res: NowResponse) {
const { query } = req.query
const {query} = req.query;
if (!query) {
return sendError(res, new Error('no query given'))
return sendError(res, new Error('no query given'));
}
try {
const response = await fetch(
`https://spectrum.chat/${encodeURIComponent(query)}`,
'GET'
)
const body = await response.text()
'GET',
);
const body = await response.text();
const availability = body.includes(
'You may be trying to view something that is deleted'
)
send(res, { availability })
'You may be trying to view something that is deleted',
);
send(res, {availability});
} catch (err) {
sendError(res, err)
sendError(res, err);
}
}