13 lines
405 B
TypeScript
13 lines
405 B
TypeScript
// Imported before Prisma so its engine cannot capture the project's live URL.
|
|
const database = process.env.TEST_DATABASE_URL;
|
|
if (database) {
|
|
const url = new URL(database);
|
|
if (
|
|
!["localhost", "127.0.0.1"].includes(url.hostname) ||
|
|
url.pathname !== "/douyin_asr_test"
|
|
) {
|
|
throw new Error("Only local douyin_asr_test database is permitted");
|
|
}
|
|
process.env.DATABASE_URL = database;
|
|
}
|