Last active
January 24, 2019 15:33
-
-
Save seanpmaxwell/729ff9a4a437c0a2cada2beee736b612 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class UserController { | |
getRoutes(): Router { | |
let router = express.Router(); | |
router.get('/api/users/:id', [middleware1, middleware2], (req, res, next) => { | |
this.get(req, res, next); | |
} | |
return router; | |
} | |
get(req: Request, res: Response, next: NextFunction): any { | |
console.log(req.params.id); | |
return res.status(200).json({msg: 'get_called'}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment