StaticTestController.js 490 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * JsonTestController
  3. *
  4. * @description :: Server-side logic for managing Jsontests
  5. * @help :: See http://links.sailsjs.org/docs/controllers
  6. */
  7. module.exports = {
  8. /**
  9. * Test 1: JSON Serialization
  10. */
  11. json: function (req, res) {
  12. return res.json({
  13. message: 'Hello, World!'
  14. });
  15. },
  16. /**
  17. * Test 6: Plaintext
  18. */
  19. plaintext: function (req, res) {
  20. res.setHeader('Content-Type', 'text/plain');
  21. return res.send("Hello, World!");
  22. }
  23. };