users.js
This file
Path
examples/content-negotiation/users.js
18 lines · 369 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 6bc7574 point at it.
docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574
lines 1–18why, one step back12var users = require('./db');34exports.html = function(req, res){5 res.send('<ul>' + users.map(function(user){6 return '<li>' + user.name + '</li>';7 }).join('') + '</ul>');8};910exports.text = function(req, res){11 res.send(users.map(function(user){12 return ' - ' + user.name + '\n';13 }).join(''));14};1516exports.json = function(req, res){17 res.json(users);18};