30 lines
739 B
TypeScript
30 lines
739 B
TypeScript
|
/**
|
||
|
* Environment variables service
|
||
|
*/
|
||
|
|
||
|
import { Env } from "@adonisjs/core/env"
|
||
|
|
||
|
export default await Env.create(new URL("../..", import.meta.url), {
|
||
|
NODE_ENV: Env.schema.enum(["development", "production", "test"] as const),
|
||
|
PORT: Env.schema.number(),
|
||
|
APP_KEY: Env.schema.string(),
|
||
|
HOST: Env.schema.string({ format: "host" }),
|
||
|
LOG_LEVEL: Env.schema.enum([
|
||
|
"fatal",
|
||
|
"error",
|
||
|
"warn",
|
||
|
"info",
|
||
|
"debug",
|
||
|
"trace",
|
||
|
] 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(),
|
||
|
})
|