2024-08-09 23:51:41 +02:00
|
|
|
/**
|
|
|
|
* Environment variables service
|
|
|
|
*/
|
|
|
|
|
|
|
|
import { Env } from "@adonisjs/core/env"
|
|
|
|
|
2024-08-16 02:50:11 +02:00
|
|
|
export default await Env.create(new URL("..", import.meta.url), {
|
|
|
|
TZ: Env.schema.string(),
|
2024-08-09 23:51:41 +02:00
|
|
|
PORT: Env.schema.number(),
|
|
|
|
HOST: Env.schema.string({ format: "host" }),
|
2024-08-16 02:50:11 +02:00
|
|
|
API_URL: Env.schema.string({ format: "url" }),
|
2024-08-09 23:51:41 +02:00
|
|
|
LOG_LEVEL: Env.schema.enum([
|
|
|
|
"fatal",
|
|
|
|
"error",
|
|
|
|
"warn",
|
|
|
|
"info",
|
|
|
|
"debug",
|
|
|
|
"trace",
|
|
|
|
] as const),
|
2024-08-16 02:50:11 +02:00
|
|
|
APP_KEY: Env.schema.string(),
|
|
|
|
NODE_ENV: Env.schema.enum(["development", "production", "test"] as const),
|
2024-08-09 23:51:41 +02:00
|
|
|
|
|
|
|
/**
|
2024-08-12 15:13:24 +02:00
|
|
|
* Variables for configuring database connection.
|
2024-08-09 23:51:41 +02:00
|
|
|
*/
|
|
|
|
DATABASE_HOST: Env.schema.string({ format: "host" }),
|
|
|
|
DATABASE_PORT: Env.schema.number(),
|
|
|
|
DATABASE_USER: Env.schema.string(),
|
|
|
|
DATABASE_PASSWORD: Env.schema.string(),
|
|
|
|
DATABASE_NAME: Env.schema.string(),
|
2024-08-23 23:21:42 +02:00
|
|
|
DATABASE_DEBUG: Env.schema.boolean(),
|
2024-08-12 15:13:24 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Variables for configuring the limiter package.
|
|
|
|
*/
|
|
|
|
LIMITER_STORE: Env.schema.enum(["database", "memory"] as const),
|
2024-08-09 23:51:41 +02:00
|
|
|
})
|