This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
wikipedia-game-solver/apps/api/start/env.ts
Théo LUDWIG 4add77856e
All checks were successful
Chromatic / chromatic (push) Successful in 2m58s
CI / ci (push) Successful in 4m43s
CI / commitlint (push) Successful in 15s
chore: try Adonis Tuyau
2024-08-16 01:50:11 +01:00

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),
})