Analytics: Laenderzuordnung
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a48e6e677
commit
8b107019c3
4 files changed
+297
-2
No files matched your search
@@ -3,13 +3,14 @@ import { join } from 'node:path';
|
||||
import { loadConfig } from './config.js';
|
||||
import { openDb } from './db.js';
|
||||
import { createSalt } from './salt.js';
|
||||
import { loadGeo } from './geo.js';
|
||||
import { createPublicServer, createAdminServer } from './server.js';
|
||||
|
||||
// Platzhalter bis Task 3 (loadGeo aus config.geoFile): kein Land.
|
||||
const geo = { lookup: () => '' };
|
||||
const config = loadConfig(process.env);
|
||||
mkdirSync(config.dataDir, { recursive: true });
|
||||
const db = openDb(join(config.dataDir, 'analytics.db'));
|
||||
const geo = loadGeo(config.geoFile || join(config.dataDir, 'geo.csv'));
|
||||
if (geo.size) console.log(`Analytics: ${geo.size} Länder-Bereiche geladen`);
|
||||
|
||||
const servers = [
|
||||
['öffentlich', createPublicServer({ config, db, geo, salt: createSalt() }), config.port],
|
||||
|
||||
Reference in new issue
Block a user