diff options
Diffstat (limited to 'env.ts')
-rw-r--r-- | env.ts | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | |-------------------------------------------------------------------------- | ||
3 | | Validating Environment Variables | ||
4 | |-------------------------------------------------------------------------- | ||
5 | | | ||
6 | | In this file we define the rules for validating environment variables. | ||
7 | | By performing validation we ensure that your application is running in | ||
8 | | a stable environment with correct configuration values. | ||
9 | | | ||
10 | | This file is read automatically by the framework during the boot lifecycle | ||
11 | | and hence do not rename or move this file to a different location. | ||
12 | | | ||
13 | */ | ||
14 | |||
15 | import Env from '@ioc:Adonis/Core/Env'; | ||
16 | |||
17 | export default Env.rules({ | ||
18 | HOST: Env.schema.string({ format: 'host' }), | ||
19 | PORT: Env.schema.number(), | ||
20 | |||
21 | APP_KEY: Env.schema.string(), | ||
22 | APP_NAME: Env.schema.string(), | ||
23 | |||
24 | NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const), | ||
25 | }); | ||