UNPKG

343 BPlain TextView Raw
1import { IController, PluginHandler } from "./types";
2
3export class Controller implements IController {
4 public path: string;
5 public handler: PluginHandler;
6 constructor(path: string, handler: PluginHandler) {
7 this.path = path;
8 this.handler = (server, opts, next) => {
9 handler(server, opts, next);
10 next();
11 };
12 }
13}