12345678910111213141516171819 |
- import { IMiddleware } from '@midwayjs/core';
- import { Middleware } from '@midwayjs/core';
- import { NextFunction, Context } from '@midwayjs/koa';
- @Middleware()
- export default class BookMiddleware
- implements IMiddleware<Context, NextFunction>
- {
- resolve() {
- return async (ctx: Context, next: NextFunction) => {
- console.log('in book middleware');
- await next();
- return 'ok';
- };
- }
- static getName() {
- return 'book_middleware';
- }
- }
|