refactor .env usage due to unexpexted env values

This commit is contained in:
Dobromir Popov
2024-03-31 20:17:06 +03:00
parent 82179f62a3
commit e5ba7a33a1
25 changed files with 53 additions and 92 deletions

View File

@ -78,8 +78,8 @@ exports.setBaseUrl = function (req) {
exports.getBaseUrl = function (relative = "", req = null) {
if (typeof window === 'undefined') {
// Server-side logic
// Read the base URL from env (NEXTAUTH_URL):
return process.env.NEXTAUTH_URL + relative;
// Read the base URL from env (PUBLIC_URL):
return process.env.PUBLIC_URL + relative;
// const filePath = path.join(__dirname, 'baseUrl.txt');
@ -122,6 +122,8 @@ exports.getPrismaClient = function getPrismaClient() {
datasources: { db: { url: process.env.DATABASE_URL } },
});
}
logger.debug("getPrismaClient: process.env.DATABASE_URL = ", process.env.DATABASE_URL);
return prisma;
}