Created
November 17, 2013 23:39
-
-
Save matthewhudson/7519861 to your computer and use it in GitHub Desktop.
Sends anything from request back as JSON
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
# Sends anything from request back as JSON | |
exports.pong = (req, res) -> | |
# Create ping-pong response from received data | |
data = | |
pongQuery: req.query | |
pongBody: req.body | |
pongParams: req.params | |
pongCookies: req.cookies | |
id: req.params.id | |
controller: req.params.controller | |
method: req.params.method | |
# Send response object as JSON | |
res.send data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment