This file contains configuration settings for your project.
The following environment variables are used in this configuration file. You can set these variables in a .env
file or directly in your environment.
Type: string
Default: "mongodb://localhost:27017"
The MongoDB connection URI.
Type: string
Default: "default"
The name of the MongoDB database.
Type: number
Default: 3001
The port number for the server to listen on.
Type: string
The secret key for signing JWT tokens.
Type: string
Default: "development"
The environment mode (e.g., "development", "production").
Type: string
The host for the email transport.
Type: number
Default: 465
The port for the email transport.
Type: boolean
Default: true
Whether the email transport uses a secure connection.
Type: string
The email address for sending emails.
Type: string
The password for the email address.
Type: string
Default: "access_token_secret"
The secret key for signing access tokens.
Type: string
Default: "refresh_token_secret"
The secret key for signing refresh tokens.
Type: string
Default: "15s"
The expiry time for access tokens.
Type: string
Default: "30d"
The expiry time for refresh tokens.
Type: string
Default: "http:localhost:3000"
The base URL for the application.
Type: string
Default: "10 minutes"
The duration for which an OTP for password reset is valid.
Type: string
Default: "3 days"
The duration for which an OTP for user invitation is valid.
Type: string
The host for the Redis server.
Type: number
Default: 6379
The port for the Redis server.
Type: string
The password for the Redis server.
Type: string
The default email address for creating new users.
Type: string
The default password for creating new users.
Type: string
The default first name for creating new users.
Type: string
The default last name for creating new users.
Create a .env
file in your project root with the following content:
MONGO_URI=mongodb://localhost:27017 MONGO_DB=my_database PORT=3000 SECRET_KEY=my_secret_key MAILER_TRANSPORT_HOST=smtp.example.com MAILER_TRANSPORT_PORT=587 MAILER_TRANSPORT_SECURE=false MAILER_EMAIL=mailer@example.com MAILER_PASSWORD=mailer_password DEFAULT_USER_EMAIL=default@example.com DEFAULT_USER_PASSWORD=default_password DEFAULT_USER_FIRST_NAME=Default DEFAULT_USER_LAST_NAME=User
Then, you can use the config.ts
file in your project.