mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: path
This commit is contained in:
parent
dfef790884
commit
d64683a617
@ -1,6 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from 'path';
|
||||||
import { AsnResponse, CityResponse, Reader } from "maxmind";
|
import { AsnResponse, CityResponse, Reader } from "maxmind";
|
||||||
|
|
||||||
import { GetServerIP } from "./serverFetch";
|
import { GetServerIP } from "./serverFetch";
|
||||||
@ -17,8 +18,12 @@ export default async function GetIPInfo({
|
|||||||
}): Promise<IPInfo> {
|
}): Promise<IPInfo> {
|
||||||
const ip = await GetServerIP({ server_id: Number(server_id) });
|
const ip = await GetServerIP({ server_id: Number(server_id) });
|
||||||
|
|
||||||
const cityDbBuffer = fs.readFileSync("./lib/GeoLite2-City.mmdb");
|
const cityDbPath = path.join(process.cwd(),"lib", 'GeoLite2-City.mmdb');
|
||||||
const asnDbBuffer = fs.readFileSync("./lib/GeoLite2-ASN.mmdb");
|
|
||||||
|
const asnDbPath = path.join(process.cwd(),"lib", 'GeoLite2-ASN.mmdb');
|
||||||
|
|
||||||
|
const cityDbBuffer = fs.readFileSync(cityDbPath);
|
||||||
|
const asnDbBuffer = fs.readFileSync(asnDbPath);
|
||||||
|
|
||||||
const cityLookup = new Reader<CityResponse>(cityDbBuffer);
|
const cityLookup = new Reader<CityResponse>(cityDbBuffer);
|
||||||
const asnLookup = new Reader<AsnResponse>(asnDbBuffer);
|
const asnLookup = new Reader<AsnResponse>(asnDbBuffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user