UNPKG

@hapiness/core

Version:

Project to have a HapiJS (https://hapijs.com/) based framework to create easier NodeJS back-end with some awesome features

52 lines (51 loc) 1.42 kB
import { CoreRoute } from './interfaces'; import { Server } from 'hapi'; export declare class LifecycleManager { /** * Initialize the lifecycle hooks * for a route * * @param {MainModule} main */ static routeLifecycle(server: Server, routes: CoreRoute[]): void; /** * Instantiate the route matching the request * And trigger OnPreAuth hook * * @param {CoreRoute[]} routes * @param {Request} request * @param {ReplyWithContinue} reply * @returns Observable */ private static instantiateRoute(routes, request, reply); /** * Find the matching route with * path and method * * @param {Request} request * @param {CoreRoute[]} routes * @returns CoreRoute */ private static findRoute(request, routes); /** * Make sure to match the right route * with the labels * * @param {string[]=[]} labels * @param {string[]=[]} routeLabels * @returns boolean */ private static isRightLabels(labels?, routeLabels?); private static arrayify(data); /** * Find the route and call * the hook if the route component * implements it * * @param {eRouteLifecycleHooks} event * @param {MainModule} mainModule * @param {} request * @param {} reply */ private static eventHandler(hook, routes, request, reply); }