refactor: load server settings from JSON configuration
This commit is contained in:
@@ -2,10 +2,11 @@ import assert from 'node:assert/strict';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { MongoClient } from 'mongodb';
|
||||
import { MongoVisitStore } from '../server/visits.ts';
|
||||
import { loadServerConfig } from '../server/config.ts';
|
||||
|
||||
// Isolated disposable database: never uses the application's MONGODB_DATABASE.
|
||||
// Isolated disposable database: never uses the application's mongoDatabase.
|
||||
const database = `sunrise_verify_${randomUUID().replaceAll('-', '')}`;
|
||||
const uri = process.env.MONGODB_URI ?? 'mongodb://172.16.0.7:27017';
|
||||
const uri = loadServerConfig().mongoUri;
|
||||
const reader = new MongoClient(uri, { serverSelectionTimeoutMS: 5000 });
|
||||
let store: MongoVisitStore | undefined;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user