UNPKG

@athenna/http

Version:

The Athenna Http server. Built on top of fastify.

99 lines (98 loc) 2.9 kB
/** * @athenna/http * * (c) João Lenon <lenon@athenna.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import 'reflect-metadata'; export declare class HttpKernel { /** * Register the @fastify/cors plugin in the Http server. */ registerCors(): Promise<void>; /** * Register the @fastify/helmet plugin in the Http server. */ registerHelmet(): Promise<void>; /** * Register the @fastify/swagger plugin in the Http server. */ registerSwagger(): Promise<void>; /** * Register the @fastify/rate-limit plugin in the Http server. */ registerRateLimit(): Promise<void>; /** * Register the @fastify/static plugin in the Http server. */ registerStatic(): Promise<void>; /** * Register the cls-rtracer plugin in the Http server. */ registerRTracer(trace?: boolean): Promise<void>; /** * Register the @athenna/vite plugin in the Http server. */ registerVite(trace?: boolean): Promise<void>; /** * Register the @fastify/multipart plugin in the Http server. */ registerMultipart(): Promise<void>; /** * Register the global log terminator in the Http server. */ registerLoggerTerminator(): Promise<void>; /** * Register all the controllers found inside "rc.controllers" config * inside the service provider. */ registerControllers(): Promise<void>; /** * Register all the middlewares found inside "rc.middlewares" config * inside the service provider. Also register if "rc.namedMiddlewares" * and "rc.globalMiddlewares" exists. */ registerMiddlewares(): Promise<void>; /** * Register all the named middlewares found inside "rc.namedMiddlewares" * property. */ registerNamedMiddlewares(): Promise<void>; /** * Register all the named middlewares found inside "rc.globalMiddlewares" * property. */ registerGlobalMiddlewares(): Promise<void>; /** * Register the exception handler for all request handlers. */ registerExceptionHandler(path?: string): Promise<void>; /** * Register the route file by importing the file. */ registerRoutes(path: string): Promise<void>; /** * Fabricate the named middlewares aliases. */ private getNamedMiddlewareAlias; /** * Fabricate the global middlewares alias and resolve the handler and * server methods. */ private getGlobalMiddlewareAliasAndHandler; /** * Register the controllers using the meta information * defined by annotations. */ private registerUsingMeta; /** * Get the configuration for the given key. */ private getConfig; /** * Get the meta URL of the project. */ private getMeta; }