-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfigue-zod.ts
More file actions
44 lines (42 loc) · 950 Bytes
/
Copy pathfigue-zod.ts
File metadata and controls
44 lines (42 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { defineConfig } from 'figue';
import { z } from 'zod';
const { config } = defineConfig(
{
env: {
doc: 'Application current environment',
default: 'development',
schema: z.enum(['development', 'production', 'test']),
env: 'NODE_ENV',
},
port: {
doc: 'Application port to listen',
schema: z.coerce.number(),
default: 3000,
env: 'PORT',
},
db: {
host: {
doc: 'Database server url',
schema: z.url(),
default: 'http://localhost:5432',
env: 'APP_DB_HOST',
},
username: {
doc: 'Database server username',
schema: z.string(),
default: 'pg',
env: 'APP_DB_USERNAME',
},
password: {
doc: 'Database server password',
schema: z.string(),
default: '',
env: 'APP_DB_PASSWORD',
},
},
},
{
envSource: process.env,
},
);
console.log(config);