Interface IAppConfig

Configuration options for the Febby application.

Example

const appConfig: IAppConfig = {
port: 3000,
db: {
url: "mongodb://localhost/mydb",
options: { useNewUrlParser: true }
},
loadDefaultMiddlewareOnAppCreation: true,
serviceName: "my-service",
hostname: "localhost",
version: "1.0.0",
bodyParser: {},
cors: {},
clusterMode: false,
appBaseUrl: "/api",
helmet: {},
morgan: {},
redis: { host: "localhost", port: 6379 }
};

Hierarchy

  • IAppConfig

Properties

app?: Express

Existing Express application instance to use.

appBaseUrl?: string

The base URL for the application.

bodyParser?: any

Middleware for parsing request bodies (e.g., JSON, URL-encoded).

clusterMode?: boolean

Whether to run the application in cluster mode.

cors?: any

Middleware for handling Cross-Origin Resource Sharing (CORS).

db?: {
    options?: ConnectOptions;
    url: string;
}

Database configuration options for connecting to MongoDB.

Type declaration

  • Optional options?: ConnectOptions

    Additional options for configuring the MongoDB connection.

  • url: string

    The URL of the MongoDB database.

helmet?: any

Middleware for enhancing application security (e.g., Helmet).

hostname?: string

The hostname of the service.

loadDefaultMiddlewareOnAppCreation?: boolean

Whether to load default middlewares when creating the app instance.

morgan?: string

Logger middleware (e.g., Morgan) configuration.

port: number

The port on which the Febby application will listen.

redis?: RedisOptions

Configuration options for Redis, used for caching.

serviceName?: string

The name of the service, used for identification.

version?: string

The version of the service.

Generated using TypeDoc