generated from fionn/ts-template
27 lines
390 B
27 lines
390 B
2 years ago
|
import fs from 'fs';
|
||
|
|
||
|
export interface WxConfig {
|
||
|
regions: WxRegion[];
|
||
|
}
|
||
|
|
||
|
export interface WxRegion {
|
||
|
identifier: string;
|
||
|
fixes: WxFix[];
|
||
|
}
|
||
|
|
||
|
export interface WxFix {
|
||
|
name: string;
|
||
|
lat: number;
|
||
|
lon: number;
|
||
|
}
|
||
|
|
||
|
export function getConfig(): WxConfig {
|
||
|
const data = JSON.parse(fs.readFileSync('/opt/wx-config.json').toString());
|
||
|
|
||
|
return data;
|
||
|
}
|
||
|
|
||
|
export default {
|
||
|
getConfig,
|
||
|
}
|