Lägesmedveten DB-URL: runtime endast DATABASE_URL, tester endast TEST_DATABASE_URL
This commit is contained in:
@@ -24,7 +24,11 @@ export interface WorkerContext {
|
||||
}
|
||||
|
||||
export function createContext(): WorkerContext {
|
||||
const { db, pool } = createDatabase();
|
||||
const databaseUrl = process.env.DATABASE_URL;
|
||||
if (!databaseUrl) {
|
||||
throw new Error("Missing DATABASE_URL. Worker must connect explicitly to the app database.");
|
||||
}
|
||||
const { db, pool } = createDatabase(databaseUrl);
|
||||
const aamos = createAamosClient();
|
||||
const apiBaseUrl = process.env.API_BASE_URL ?? "http://localhost:4000";
|
||||
const secret = process.env.ENTITLEMENT_SIGNING_SECRET ?? "dev-only-change-me-three";
|
||||
|
||||
Reference in New Issue
Block a user