-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ts
48 lines (43 loc) · 2.38 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* eslint-disable no-console */
import { resolve } from 'node:path';
import { APIS, Language } from './config';
import { version } from './package.json';
import { StatusPageChecker } from './structures/StatusPageChecker';
import TranslationsDE from './translations/de';
import TranslationsEN from './translations/en';
console.log('─────────────────────────────────────────────────────');
console.log(' ');
console.log(`
╔═══╗─────────────╔╗──╔═══╗╔╗───╔╗
╚╗╔╗║─────────────║║──║╔═╗╠╝╚╗─╔╝╚╗
─║║║╠╦══╦══╦══╦═╦═╝║──║╚══╬╗╔╬═╩╗╔╬╗╔╦══╦══╦══╦══╦══╗
─║║║╠╣══╣╔═╣╔╗║╔╣╔╗╠══╬══╗║║║║╔╗║║║║║║══╣╔╗║╔╗║╔╗║║═╣
╔╝╚╝║╠══║╚═╣╚╝║║║╚╝╠══╣╚═╝║║╚╣╔╗║╚╣╚╝╠══║╚╝║╔╗║╚╝║║═╣
╚═══╩╩══╩══╩══╩╝╚══╝──╚═══╝╚═╩╝╚╩═╩══╩══╣╔═╩╝╚╩═╗╠══╝
────────────────────────────────────────║║────╔═╝║
────────────────────────────────────────╚╝────╚══╝`);
console.log(' ');
console.log(`by fh.prv <info@fhprv.de> ・ v${version} ・ © 2023 fh.prv - MIT Licence`);
console.log(' ');
console.log('─────────────────────────────────────────────────────');
let translations = TranslationsEN;
switch (Language) {
case 'de': {
translations = TranslationsDE;
break;
}
case 'en':
default: {
translations = TranslationsEN;
break;
}
}
for (const API of APIS) {
const name = new URL(API).hostname.split('.')[0];
new StatusPageChecker({
db: resolve(__dirname, `./db/${name}.json`),
name,
translations,
url: API,
});
}