Refine project structure

This commit is contained in:
Peng-YM
2022-05-25 14:33:46 +08:00
parent bbe29a7fac
commit 6169ff5255
10 changed files with 86 additions and 88 deletions

View File

@@ -0,0 +1,10 @@
import { HTTP } from '../vendor/open-api';
export default async function IP_API(req, res) {
const server = decodeURIComponent(req.params.server);
const $http = HTTP();
const result = await $http
.get(`http://ip-api.com/json/${server}?lang=zh-CN`)
.then((resp) => JSON.parse(resp.body));
res.json(result);
}