mirror of
https://github.com/fosrl/pangolin.git
synced 2025-12-14 03:56:54 +00:00
14 lines
387 B
TypeScript
14 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 };
|