Skip to main content
Version: 3x

Function: createServer

createServer(config): Promise<{ instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance> & PromiseLike<FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>> ; start: () => Promise<void> ; stop: () => Promise<void> }>

Create instance of development server, powered by Fastify.

Parameters

NameTypeDescription
configConfigServer configuration.

Returns

Promise<{ instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance> & PromiseLike<FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>> ; start: () => Promise<void> ; stop: () => Promise<void> }>

start and stop functions as well as an underlying Fastify instance.

Defined in

createServer.ts:21