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

@@ -1,5 +1,3 @@
import { HTTP } from './open-api';
// get proxy flag according to its name
export function getFlag(name) {
// flags from @KOP-XIAO: https://github.com/KOP-XIAO/QuantumultX/blob/master/Scripts/resource-parser.js
@@ -307,13 +305,3 @@ export function getFlag(name) {
) || [])[0];
return oldFlag || '🏴‍☠️';
}
// util API
export 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);
}