Skip to content

covenix / ServeOptions

Interface: ServeOptions

Defined in: src/express.ts:59

Options for serveToExpressOptions plus where to listen.

Extends

Properties

after?

optional after?: (app) => void

Defined in: src/express.ts:55

Runs after routes but before the error handler — e.g. a SPA fallback (app.get('{*path}', …)) that must sit after the API routes.

Parameters

app

Express

Returns

void

Inherited from

ToExpressOptions.after


app?

optional app?: Express

Defined in: src/express.ts:23

An existing Express app to build onto. Defaults to a fresh express(). Use this to layer covenix onto an app you've already partly configured.

Inherited from

ToExpressOptions.app


configure?

optional configure?: (app) => void

Defined in: src/express.ts:50

Runs before routes (and before the body parsers) — the place for pre-route middleware: CORS, helmet, logging, static files, header-based auth. Note: fires before body parsing, so middleware needing a parsed body must add its own parser here.

Parameters

app

Express

Returns

void

Inherited from

ToExpressOptions.configure


docs?

optional docs?: boolean | ServeDocsOptions & object

Defined in: src/express.ts:38

Serve the docs UI via Covenix.serveDocs. true (default) mounts at /docs; an object customizes path and the UI options; false skips it.

Inherited from

ToExpressOptions.docs


errorHandler?

optional errorHandler?: boolean | RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

Defined in: src/express.ts:43

Install an error handler last. true (default) uses covenixErrorHandler; a function installs your own; false skips it.

Inherited from

ToExpressOptions.errorHandler


host?

optional host?: string

Defined in: src/express.ts:63

Host/interface to bind. Defaults to all interfaces.


json?

optional json?: boolean | OptionsJson

Defined in: src/express.ts:28

Mount express.json(). true (default) uses defaults; an object passes body-parser options (e.g. { limit: '1mb' }); false skips it.

Inherited from

ToExpressOptions.json


port?

optional port?: number

Defined in: src/express.ts:61

Port to listen on. Defaults to 3000.


urlencoded?

optional urlencoded?: boolean | OptionsUrlencoded

Defined in: src/express.ts:33

Mount express.urlencoded(). false (default) skips it; true uses { extended: true }; an object passes body-parser options.

Inherited from

ToExpressOptions.urlencoded