-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.ts
57 lines (54 loc) · 1.22 KB
/
config.ts
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
45
46
47
48
49
50
51
52
53
54
55
56
57
import convict from 'convict';
const config = convict({
env: {
doc: 'The application environment.',
format: ['production', 'development', 'test'],
default: 'development',
env: 'NODE_ENV'
},
admin: {
email: {
doc: 'The admin email to be generated',
format: String,
default: '[email protected]',
env: 'ADMIN_EMAIL',
sensitive: true
},
password: {
doc: 'The admin password to be generated',
format: String,
default: 'password',
env: 'ADMIN_PASSWORD',
sensitive: true
}
},
mongodb: {
doc: 'The uri to the mongo database',
format: String,
default: 'mongodb://localhost:27017/silent-auction',
env: 'MONGODB_URI',
sensitive: true
},
port: {
doc: 'The port for the express server to run on',
format: 'port',
default: 3001,
env: 'PORT'
},
jwt: {
secret: {
doc: 'The jwt token secret for authenticating users',
format: String,
default: 'jwt_token_secret',
env: 'JWT_SECRET'
},
expireIn: {
doc: 'How long the jwt token lasts',
format: String,
default: '24h',
env: 'JWT_TIME'
}
}
});
config.validate({ allowed: 'strict' });
export default config;