aboutsummaryrefslogtreecommitdiffstats
path: root/start/env.ts
diff options
context:
space:
mode:
Diffstat (limited to 'start/env.ts')
-rw-r--r--start/env.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/start/env.ts b/start/env.ts
new file mode 100644
index 0000000..3e1702e
--- /dev/null
+++ b/start/env.ts
@@ -0,0 +1,24 @@
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*/
14import { Env } from '@adonisjs/core/env'
15
16export default await Env.create(new URL('../', import.meta.url), {
17 HOST: Env.schema.string({ format: 'host' }),
18 PORT: Env.schema.number(),
19
20 APP_KEY: Env.schema.string(),
21 APP_NAME: Env.schema.string(),
22
23 NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
24})