mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
Chungus
This commit is contained in:
13
server/db/maxmind.ts
Normal file
13
server/db/maxmind.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user