routes.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * Route Mappings
  3. * (sails.config.routes)
  4. *
  5. * Your routes map URLs to views and controllers.
  6. *
  7. * If Sails receives a URL that doesn't match any of the routes below,
  8. * it will check for matching files (images, scripts, stylesheets, etc.)
  9. * in your assets directory. e.g. `http://localhost:1337/images/foo.jpg`
  10. * might match an image file: `/assets/images/foo.jpg`
  11. *
  12. * Finally, if those don't match either, the default 404 handler is triggered.
  13. * See `api/responses/notFound.js` to adjust your app's 404 logic.
  14. *
  15. * Note: Sails doesn't ACTUALLY serve stuff from `assets`-- the default Gruntfile in Sails copies
  16. * flat files from `assets` to `.tmp/public`. This allows you to do things like compile LESS or
  17. * CoffeeScript for the front-end.
  18. *
  19. * For more information on configuring custom routes, check out:
  20. * http://sailsjs.org/#/documentation/concepts/Routes/RouteTargetSyntax.html
  21. */
  22. module.exports.routes = {
  23. /***************************************************************************
  24. * *
  25. * Make the view located at `views/homepage.ejs` (or `views/homepage.jade`, *
  26. * etc. depending on your default view engine) your home page. *
  27. * *
  28. * (Alternatively, remove this and add an `index.html` file in your *
  29. * `assets` directory) *
  30. * *
  31. ***************************************************************************/
  32. '/': {
  33. view: 'homepage'
  34. },
  35. /***************************************************************************
  36. * *
  37. * Custom routes here... *
  38. * *
  39. * If a request to a URL doesn't match any of the custom routes above, it *
  40. * is matched against Sails route blueprints. See `config/blueprints.js` *
  41. * for configuration options and examples. *
  42. * *
  43. ***************************************************************************/
  44. // TFB routes here
  45. 'get /json': 'StaticTestController.Json',
  46. 'get /plaintext': 'StaticTestController.Plaintext',
  47. 'get /mysql/db': 'SequelizeMySQLController.Single',
  48. 'get /mysql/queries': 'SequelizeMySQLController.Multiple',
  49. 'get /mysql/fortunes': 'SequelizeMySQLController.Fortunes',
  50. 'get /mysql/updates': 'SequelizeMySQLController.Updates',
  51. 'get /postgres/db': 'SequelizePostgresController.Single',
  52. 'get /postgres/queries': 'SequelizePostgresController.Multiple',
  53. 'get /postgres/fortunes': 'SequelizePostgresController.Fortunes',
  54. 'get /postgres/updates': 'SequelizePostgresController.Updates',
  55. 'get /hiredis/db': 'RedisController.Single',
  56. 'get /hiredis/queries': 'RedisController.Multiple',
  57. 'get /hiredis/fortunes': 'RedisController.Fortunes',
  58. 'get /hiredis/updates': 'RedisController.Updates'
  59. };