Skip to content
Flowline

Configuration Reference

Overview

Configuration can be provided via:

  1. config.js file
  2. Environment variables
  3. Command-line flags

Priority: CLI flags > Environment > Config file

Options

name

Application name.

  • Type: string
  • Default: 'App'
  • Env: APP_NAME
{ name: 'My Application' }

port

Server port number.

  • Type: number
  • Default: 3000
  • Env: PORT
{ port: 8080 }

debug

Enable debug mode.

  • Type: boolean
  • Default: false
  • Env: DEBUG
{ debug: true }

database

Database connection settings.

  • Type: object
{
database: {
host: 'localhost',
port: 5432,
name: 'mydb',
user: 'admin',
password: 'secret',
ssl: false,
}
}
PropertyTypeDefaultDescription
hoststring'localhost'Database host
portnumber5432Database port
namestring'app'Database name
userstring-Username
passwordstring-Password
sslbooleanfalseUse SSL

cache

Caching configuration.

  • Type: object
{
cache: {
enabled: true,
driver: 'memory', // 'memory' | 'redis' | 'file'
ttl: 3600,
}
}

logging

Logging configuration.

  • Type: object
{
logging: {
level: 'info', // 'debug' | 'info' | 'warn' | 'error'
format: 'json', // 'json' | 'pretty'
output: 'stdout', // 'stdout' | 'file'
}
}

Full Example

config.js
export default {
name: 'My Application',
port: 3000,
debug: false,
database: {
host: process.env.DB_HOST || 'localhost',
port: 5432,
name: 'myapp',
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
},
cache: {
enabled: true,
driver: 'redis',
ttl: 3600,
},
logging: {
level: 'info',
format: 'json',
},
};