globals.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Global Variable Configuration
  3. * (sails.config.globals)
  4. *
  5. * Configure which global variables which will be exposed
  6. * automatically by Sails.
  7. *
  8. * For more information on configuration, check out:
  9. * http://sailsjs.org/#/documentation/reference/sails.config/sails.config.globals.html
  10. */
  11. module.exports.globals = {
  12. /****************************************************************************
  13. * *
  14. * Expose the lodash installed in Sails core as a global variable. If this *
  15. * is disabled, like any other node module you can always run npm install *
  16. * lodash --save, then var _ = require('lodash') at the top of any file. *
  17. * *
  18. ****************************************************************************/
  19. // _: true,
  20. /****************************************************************************
  21. * *
  22. * Expose the async installed in Sails core as a global variable. If this is *
  23. * disabled, like any other node module you can always run npm install async *
  24. * --save, then var async = require('async') at the top of any file. *
  25. * *
  26. ****************************************************************************/
  27. // async: true,
  28. /****************************************************************************
  29. * *
  30. * Expose the sails instance representing your app. If this is disabled, you *
  31. * can still get access via req._sails. *
  32. * *
  33. ****************************************************************************/
  34. // sails: true,
  35. /****************************************************************************
  36. * *
  37. * Expose each of your app's services as global variables (using their *
  38. * "globalId"). E.g. a service defined in api/models/NaturalLanguage.js *
  39. * would have a globalId of NaturalLanguage by default. If this is disabled, *
  40. * you can still access your services via sails.services.* *
  41. * *
  42. ****************************************************************************/
  43. // services: true,
  44. /****************************************************************************
  45. * *
  46. * Expose each of your app's models as global variables (using their *
  47. * "globalId"). E.g. a model defined in api/models/User.js would have a *
  48. * globalId of User by default. If this is disabled, you can still access *
  49. * your models via sails.models.*. *
  50. * *
  51. ****************************************************************************/
  52. // models: true
  53. };