Constants · In depth

HTTP_OPTIONS

Frozen defaults used by the HTTP and HTTPS server constructors.

Explain it like I’m five

The simple mental model

HTTP_OPTIONS is Redweb’s starter checklist for HTTP servers: port, bind address, public folders, encoding, and related defaults.

When it fits

When should I use it?

Consult it when you need to know what omitted HttpServer options mean or when generating configuration documentation.

A practical API pattern

Follow the example

This pattern explains the named API. Application classes, credentials, and assets may need to be supplied; use a complete recipe for a runnable starting point.

Read this article as Markdown

JavaScript
const { HTTP_OPTIONS } = require('redweb')
// port 80, bind 0.0.0.0, publicPaths ['./public'],
// listen true, encoding 'json', and safe error exposure disabled
  1. 1

    The server copies its baseline HTTP choices.

  2. 2

    Your provided values are validated and merged.

  3. 3

    The completed configuration drives app creation and optional listener startup.

Surface area

Methods and members

Server defaults

port, bind, listen, ssl, logger, and static public paths.

Application defaults

services, encoding, CORS, and safe error exposure.