Skip to main content
Version: 3x

Function: createServer

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

Create instance of development server, powered by Fastify.

Parameters

NameTypeDescription
configConfigServer configuration.

Returns

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

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

Defined in

createServer.ts:21