Categories
express node.js

Express: the basics

On returning content

# automagically detects content and set the right headers:

res.send(returnhere)

# explicitly return json objects:

res.json(JSON.stringify(returnhere))

# you are more interested in sending http codes than actual return objects:

res.status(404).end();

Leave a Reply

Your email address will not be published. Required fields are marked *