-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
Nadhi-(Kushi) edited this page Apr 1, 2026
·
2 revisions
The primary configuration surface is createApp(config) plus app.listen(options).
import { createApp } from "@http-native/core";
const app = createApp({
server: {
host: "127.0.0.1",
port: 3000,
backlog: 2048,
maxHeaderBytes: 16 * 1024,
},
tls: null,
dev: {
logger: true,
hotReload: false,
hotReloadPaths: ["src"],
hotReloadDebounceMs: 120,
devComments: true,
timing: false,
cache: false,
},
});host?: stringport?: numberbacklog?: numbermaxHeaderBytes?: number
cert: stringkey: stringca?: stringpassphrase?: string
Values can be PEM strings or file paths.
logger?: booleanhotReload?: booleanhotReloadPaths?: string[]hotReloadDebounceMs?: numberdevComments?: booleannotify?: booleantiming?: booleancache?: boolean
logger is the main switch for optimizer/log output. notify is just an alias.
const server = await app.listen({
host: "0.0.0.0",
port: 3000,
backlog: 2048,
});Options:
host?: stringport?: numberbacklog?: numberserverConfig?: HttpServerConfig
const server = await app.listen()
.port(443)
.tls({
cert: "./cert.pem",
key: "./key.pem",
});For dev reload:
await app.listen().port(3000).hot({
paths: ["src"],
debounceMs: 80,
});app.reload({
files: ["src", "routes"],
debounceMs: 80,
clear: true,
});Options:
watch?: string[]files?: string[]debounceMs?: numberclear?: boolean
The package also exports @http-native/core/http-server.config. That module contains the default low-level HTTP server constants and normalization helpers. It is not the primary way to configure an app.
Http-native is open to everyone, but we have strict regulations and licensing fees for large organizations