-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.ts
More file actions
50 lines (42 loc) · 1.69 KB
/
env.ts
File metadata and controls
50 lines (42 loc) · 1.69 KB
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
/*
|--------------------------------------------------------------------------
| Validating Environment Variables
|--------------------------------------------------------------------------
|
| In this file we define the rules for validating environment variables.
| By performing validation we ensure that your application is running in
| a stable environment with correct configuration values.
|
| This file is read automatically by the framework during the boot lifecycle
| and hence do not rename or move this file to a different location.
|
*/
import Env from '@ioc:Adonis/Core/Env'
export default Env.rules({
PORT: Env.schema.number(),
HOST: Env.schema.string({ format: 'host' }),
APP_KEY: Env.schema.string(),
APP_NAME: Env.schema.string(),
NODE_ENV: Env.schema.enum(['development', 'production', 'testing'] as const),
CACHE_VIEWS: Env.schema.boolean(),
WEB_URL: Env.schema.string(),
// Variables for the database
DB_CONNECTION: Env.schema.string(),
DB_HOST: Env.schema.string(), // no format because "host" format don't accept docker container names
DB_USER: Env.schema.string(),
DB_PASSWORD: Env.schema.string.optional(),
DB_NAME: Env.schema.string(),
// Variables for social auth
GOOGLE_CLIENT_ID: Env.schema.string(),
GOOGLE_CLIENT_SECRET: Env.schema.string(),
FACEBOOK_CLIENT_ID: Env.schema.string(),
FACEBOOK_CLIENT_SECRET: Env.schema.string(),
LINKEDIN_CLIENT_ID: Env.schema.string(),
LINKEDIN_CLIENT_SECRET: Env.schema.string(),
STRIPE_SECRET: Env.schema.string(),
STRIPE_ENDPOINT_SECRET: Env.schema.string.optional(),
DISCORD_TOKEN: Env.schema.string(),
DISCORD_ADMIN_ID: Env.schema.string(),
// Variable for mailer
SPARKPOST_API_KEY: Env.schema.string(),
})