Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Get("/")
public testGet() { return "GET"; }
@All("/")
public testAll() { return "ALL"; }
@Delete("/")
public testDelete() { return "DELETE"; }
@Head("/")
public testHead() { return "HEAD"; }
@Put("/")
public testPut() { return "PUT"; }
@Patch("/")
public testPatch() { return "PATCH"; }
@Post("/")
public testPost() { return "POST"; }
@Method("foo", "/")
public testMethod() { return "METHOD:FOO"; }
}
kernel.bind(TYPE.Controller).to(TestController);
function m1(req: express.Request, res: express.Response, next: express.NextFunction) { next(); }
function m2(req: express.Request, res: express.Response, next: express.NextFunction) { next(); }
function m3(req: express.Request, res: express.Response, next: express.NextFunction) { next(); }
@Controller("/", m1, m2, m3)
@Get("/", m1, m2, m3)
public testGet() { return "GET"; }
@All("/", m1, m2, m3)
public testAll() { return "ALL"; }
@Delete("/", m1, m2, m3)
public testDelete() { return "DELETE"; }
@Head("/", m1, m2, m3)
public testHead() { return "HEAD"; }
@Put("/", m1, m2, m3)
public testPut() { return "PUT"; }
@Patch("/", m1, m2, m3)
public testPatch() { return "PATCH"; }
@Post("/", m1, m2, m3)
public testPost() { return "POST"; }
@Method("foo", "/", m1, m2, m3)
public testMethod() { return "METHOD:FOO"; }
}
}