@chubbyts/chubbyts-framework
Version:
A minimal, highly performant middleware PSR-15 inspired function based microframework built with as little complexity as possible, aimed primarily at those developers who want to understand all the vendors they use.
18 lines (17 loc) • 1.04 kB
TypeScript
import type { Handler } from '@chubbyts/chubbyts-http-types/dist/handler';
import type { Middleware } from '@chubbyts/chubbyts-http-types/dist/middleware';
import type { MiddlewareDispatcher } from './middleware/middleware-dispatcher.js';
/**
* ```ts
* import type { Middleware } from '@chubbyts/chubbyts-http-types/dist/middleware';
* import { createErrorMiddleware } from '@chubbyts/chubbyts-framework/dist/middleware/error-middleware';
* import { createRouteMatcherMiddleware } from '@chubbyts/chubbyts-framework/dist/middleware/route-matcher-middleware';
* import { createApplication } from '@chubbyts/chubbyts-framework/dist/application';
*
* const errorMiddleware: Middleware = createErrorMiddleware(...);
* const errorMiddleware: Middleware = createRouteMatcherMiddleware(...);
*
* const application = createApplication([ errorMiddleware, routeMatcherMiddleware ]);
* ```
*/
export declare const createApplication: (middlewares: Array<Middleware>, middlewareDispatcher?: MiddlewareDispatcher, handler?: Handler) => Handler;