Class: VrameworkFastifyServer
The VrameworkFastifyServer
class provides a Fastify server integrated with the Vramework framework.
This class helps in quickly setting up a Fastify server with Vramework's core features, including health checks,
route handling, and integration with singleton and session services.
Constructors
new VrameworkFastifyServer()
new VrameworkFastifyServer(
config,
singletonServices,
createSessionServices): VrameworkFastifyServer
Constructs a new instance of the VrameworkFastifyServer
class.
Parameters
• config: CoreServerConfig
The configuration for the server.
• singletonServices: CoreSingletonServices
The singleton services used by the server.
• createSessionServices: CreateSessionServices
<any
, any
, any
>
Function to create session services for each request.
Returns
Defined in
packages/servers/fastify/fastify-server/src/vramework-fastify-server.ts:26
Properties
app
app: FastifyInstance<Server<typeof IncomingMessage, typeof ServerResponse>, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<Server<typeof IncomingMessage, typeof ServerResponse>, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProviderDefault>> & object;
The Fastify app instance
Defined in
packages/servers/fastify/fastify-server/src/vramework-fastify-server.ts:17
Methods
enableCors()
enableCors(_options): void
Placeholder for enabling CORS.
Parameters
• _options: any
The options to configure CORS.
Returns
void
Throws
Method not implemented.
Defined in
packages/servers/fastify/fastify-server/src/vramework-fastify-server.ts:38
enableExitOnSigInt()
enableExitOnSigInt(): Promise<void>
Enables the server to exit gracefully when a SIGINT signal is received.
Returns
Promise
<void
>
Defined in
packages/servers/fastify/fastify-server/src/vramework-fastify-server.ts:86
init()
init(): Promise<void>
Initializes the server by setting up health check and registering the Vramework Fastify plugin.
Returns
Promise
<void
>
Defined in
packages/servers/fastify/fastify-server/src/vramework-fastify-server.ts:45
start()
start(): Promise<void>
Starts the server and begins listening on the configured hostname and port.
Returns
Promise
<void
>
Defined in
packages/servers/fastify/fastify-server/src/vramework-fastify-server.ts:64
stop()
stop(): Promise<void>
Stops the server and closes all connections.
Returns
Promise
<void
>
Defined in
packages/servers/fastify/fastify-server/src/vramework-fastify-server.ts:77