Connectum API Reference / @connectum/core / types / CreateServerOptions
Interface: CreateServerOptions
Defined in: packages/core/src/types.ts:214
Server configuration options for createServer()
Properties
allowHTTP1?
optionalallowHTTP1?:boolean
Defined in: packages/core/src/types.ts:298
Allow HTTP/1.1 connections.
With TLS: enables ALPN negotiation (both HTTP/1.1 and HTTP/2). Without TLS: creates HTTP/1.1 server (http.createServer). Set to false without TLS for h2c-only (http2.createServer).
Default
trueeventBus?
optionaleventBus?:EventBusLike
Defined in: packages/core/src/types.ts:287
Event bus instance for pub/sub messaging.
The event bus is started during server.start() (after route building, before transport listen) and stopped during graceful shutdown.
Example
import { createEventBus } from '@connectum/events';
import { NatsAdapter } from '@connectum/events-nats';
const eventBus = createEventBus({
adapter: NatsAdapter({ servers: ['nats://localhost:4222'] }),
router: eventRouter,
});
const server = createServer({
services: [routes],
eventBus,
});handshakeTimeout?
optionalhandshakeTimeout?:number
Defined in: packages/core/src/types.ts:304
Handshake timeout in milliseconds
Default
30000host?
optionalhost?:string
Defined in: packages/core/src/types.ts:230
Server host to bind
Default
"0.0.0.0"http2Options?
optionalhttp2Options?:SecureServerOptions<typeofIncomingMessage, typeofServerResponse, typeofHttp2ServerRequest, typeofHttp2ServerResponse>
Defined in: packages/core/src/types.ts:309
Additional HTTP/2 server options
interceptors?
optionalinterceptors?:Interceptor[]
Defined in: packages/core/src/types.ts:263
ConnectRPC interceptors. When omitted or [], no interceptors are applied. Use createDefaultInterceptors() from @connectum/interceptors to get the default chain.
port?
optionalport?:number
Defined in: packages/core/src/types.ts:224
Server port
Default
5000protocols?
optionalprotocols?:ProtocolRegistration[]
Defined in: packages/core/src/types.ts:251
Protocol registrations (healthcheck, reflection, custom)
Example
import { Healthcheck } from '@connectum/healthcheck';
import { Reflection } from '@connectum/reflection';
const server = createServer({
services: [routes],
protocols: [Healthcheck({ httpEnabled: true }), Reflection()],
});services
services:
ServiceRoute[]
Defined in: packages/core/src/types.ts:218
Service routes to register
shutdown?
optionalshutdown?:ShutdownOptions
Defined in: packages/core/src/types.ts:256
Graceful shutdown configuration
tls?
optionaltls?:TLSOptions
Defined in: packages/core/src/types.ts:235
TLS configuration
