pangolin/server/db/maxmind.ts
2025-10-04 18:36:44 -07:00

13 lines
387 B
TypeScript

import maxmind, { CountryResponse, Reader } from "maxmind";
import config from "@server/lib/config";
let maxmindLookup: Reader<CountryResponse> | null;
if (config.getRawConfig().server.maxmind_db_path) {
maxmindLookup = await maxmind.open<CountryResponse>(
config.getRawConfig().server.maxmind_db_path!
);
} else {
maxmindLookup = null;
}
export { maxmindLookup };