mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-28 20:59:23 +00:00
wip
This commit is contained in:
15
apps/server/src/env.js
Normal file
15
apps/server/src/env.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const { z } = require('zod');
|
||||
|
||||
/*eslint sort-keys: "error"*/
|
||||
const envSchema = z.object({
|
||||
NODE_ENV: z.enum(['development', 'test', 'production']),
|
||||
COOLIFY_SECRET_KEY: z.string()
|
||||
});
|
||||
|
||||
const env = envSchema.safeParse(process.env);
|
||||
|
||||
if (!env.success) {
|
||||
console.error('❌ Invalid environment variables:', JSON.stringify(env.error.format(), null, 4));
|
||||
process.exit(1);
|
||||
}
|
||||
module.exports.env = env.data;
|
||||
Reference in New Issue
Block a user