mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
use findFile() api
This commit is contained in:
1 parent
8a8e312ca4
commit
9a538130ee
10 files changed
+105
-52
No files matched your search
@@ -1,9 +1,9 @@
|
||||
import 'hydrooj';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { Reader } from 'maxmind';
|
||||
import { findFileSync } from '@hydrooj/utils/lib/utils';
|
||||
|
||||
const buffer = fs.readFileSync(path.resolve(__dirname, 'GeoLite2-City.mmdb'));
|
||||
const buffer = fs.readFileSync(findFileSync('@hydrooj/geoip/GeoLite2-City.mmdb'));
|
||||
const reader = new Reader(buffer);
|
||||
|
||||
export interface Result {
|
||||
|
||||
Reference in new issue
Block a user