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

38 lines
985 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(),
DATABASE_DEBUG: Env.schema.boolean(),
/**
* Variables for configuring the limiter package.
*/
LIMITER_STORE: Env.schema.enum(["database", "memory"] as const),
})