rest-vir - v1.0.0
    Preparing search index...

    Function attachService

    • Attach all handlers for a ServiceImplementation to any existing Fastify server.

      Parameters

      • server: Readonly<FastifyInstance>
      • service: Readonly<
            SelectFrom<
                GenericServiceImplementation,
                {
                    createContext: true;
                    endpoints: true;
                    logger: true;
                    postHook: true;
                    requiredClientOrigin: true;
                    serviceName: true;
                    serviceOrigin: true;
                    webSockets: true;
                },
            >,
        >
      • options: Readonly<HandleRouteOptions> = {}

      Returns Promise<void>

      import fastify from 'fastify';

      const server = fastify();

      attachService(service, myServiceImplementation);

      await server.listen({port: 3000});