index.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //Top-Level Router
  2. //Mounts all the individual routes on a single router that the app can then use
  3. var router = require('express').Router();
  4. //NOTE: Each 'sub-router' should go below and use the following convention:
  5. //router.use(<PATH>, require(<MODULE>));
  6. //where PATH = sub-path of main router
  7. //where MODULE = the module containing the exported sub-router
  8. //Mount the 'admin' router onto the API Router
  9. //URL will look like this: '.../api/admin/...'
  10. router.use('/admin', require('./admin'));
  11. //Mount the 'admins' router onto the API Router
  12. //URL will look like this: '.../api/admins/...'
  13. router.use('/admins', require('./admins'));
  14. //Mount the 'news' router onto the API Router
  15. //URL will look like this: '.../api/news/...'
  16. router.use('/news', require('./news'));
  17. //Mount the 'tool' router onto the API Router
  18. //URL will look like this: '.../api/tool/...'
  19. router.use('/tool', require('./tool'));
  20. //Mount the 'tools' router onto the API Router
  21. //URL will look like this: '.../api/tools/...'
  22. router.use('/tools', require('./tools'));
  23. //Mount the 'jira' router on the API Router
  24. //URL will look like this: '.../api/jira/...'
  25. router.use('/jira', require('./jira'));
  26. //!IMPORTANT! We need to export the router so our app can use the router
  27. module.exports = router;