mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
Refine project structure
This commit is contained in:
10
backend/src/utils/ip-api.js
Normal file
10
backend/src/utils/ip-api.js
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user