37 lines
945 B
TypeScript
37 lines
945 B
TypeScript
/**
|
|
* Environment variables service
|
|
*/
|
|
|
|
import { Env } from "@adonisjs/core/env"
|
|
|
|
export default await Env.create(new URL("..", import.meta.url), {
|
|
TZ: Env.schema.string(),
|
|
PORT: Env.schema.number(),
|
|
HOST: Env.schema.string({ format: "host" }),
|
|
API_URL: Env.schema.string({ format: "url" }),
|
|
LOG_LEVEL: Env.schema.enum([
|
|
"fatal",
|
|
"error",
|
|
"warn",
|
|
"info",
|
|
"debug",
|
|
"trace",
|
|
] as const),
|
|
APP_KEY: Env.schema.string(),
|
|
NODE_ENV: Env.schema.enum(["development", "production", "test"] as const),
|
|
|
|
/**
|
|
* Variables for configuring database connection.
|
|
*/
|
|
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(),
|
|
|
|
/**
|
|
* Variables for configuring the limiter package.
|
|
*/
|
|
LIMITER_STORE: Env.schema.enum(["database", "memory"] as const),
|
|
})
|