@goweekdays/auth-module
v0.2.8
Published
This file contains configuration settings for your project.
Downloads
428
Readme
config.ts
This file contains configuration settings for your project.
Environment Variables
The following environment variables are used in this configuration file. You can set these variables in a .env
file or directly in your environment.
MONGO_URI
Type: string
Default: "mongodb://localhost:27017"
The MongoDB connection URI.
MONGO_DB
Type: string
Default: "default"
The name of the MongoDB database.
PORT
Type: number
Default: 3001
The port number for the server to listen on.
SECRET_KEY
Type: string
The secret key for signing JWT tokens.
NODE_ENV
Type: string
Default: "development"
The environment mode (e.g., "development", "production").
MAILER_TRANSPORT_HOST
Type: string
The host for the email transport.
MAILER_TRANSPORT_PORT
Type: number
Default: 465
The port for the email transport.
MAILER_TRANSPORT_SECURE
Type: boolean
Default: true
Whether the email transport uses a secure connection.
MAILER_EMAIL
Type: string
The email address for sending emails.
MAILER_PASSWORD
Type: string
The password for the email address.
ACCESS_TOKEN_SECRET
Type: string
Default: "access_token_secret"
The secret key for signing access tokens.
REFRESH_TOKEN_SECRET
Type: string
Default: "refresh_token_secret"
The secret key for signing refresh tokens.
ACCESS_TOKEN_EXPIRY
Type: string
Default: "15s"
The expiry time for access tokens.
REFRESH_TOKEN_EXPIRY
Type: string
Default: "30d"
The expiry time for refresh tokens.
APP_ACCOUNT
Type: string
Default: "http:localhost:3000"
The base URL for the application.
OTP_FORGET_PASSWORD_DURATION
Type: string
Default: "10 minutes"
The duration for which an OTP for password reset is valid.
OTP_USER_INVITE_DURATION
Type: string
Default: "3 days"
The duration for which an OTP for user invitation is valid.
REDIS_HOST
Type: string
The host for the Redis server.
REDIS_PORT
Type: number
Default: 6379
The port for the Redis server.
REDIS_PASSWORD
Type: string
The password for the Redis server.
DEFAULT_USER_EMAIL
Type: string
The default email address for creating new users.
DEFAULT_USER_PASSWORD
Type: string
The default password for creating new users.
DEFAULT_USER_FIRST_NAME
Type: string
The default first name for creating new users.
DEFAULT_USER_LAST_NAME
Type: string
The default last name for creating new users.
Example
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 [email protected] MAILER_PASSWORD=mailer_password [email protected] 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.