Skip to content

Commit

Permalink
export Context from koa.Application.Context
Browse files Browse the repository at this point in the history
  • Loading branch information
iyobo committed May 25, 2023
1 parent 7aa9d1e commit 2a1fd33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {generateOpenApi, openApiSpec} from './openapi/OpenApi';
import Router from 'koa-router';
import bodyParser from 'koa-body';
import {addArgumentInjectMeta} from './util/tools';
import Application from 'koa';
import KoaApplication from 'koa';
import koaHelmet from 'koa-helmet';
import {AmalaOptions} from './types/AmalaOptions';
import {KoaBodyOptions} from './types/KoaBodyOptions';
Expand Down Expand Up @@ -47,9 +47,9 @@ export const controllers = {};
*/
export const bootstrapControllers = async (
params: AmalaOptions
): Promise<{ app: Application; router: Router }> => {
): Promise<{ app: KoaApplication; router: Router }> => {
options = params;
const app = options.app = options.app || new Application();
const app = options.app = options.app || new KoaApplication();
options.router = options.router || new Router();

options.versions = options.versions || {1: true};
Expand Down Expand Up @@ -174,4 +174,6 @@ export {
*/
export const addArgumentDecorator = addArgumentInjectMeta;

export const errors = Boom
export const errors = Boom

export type Context = KoaApplication.Context

0 comments on commit 2a1fd33

Please sign in to comment.