Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

res.json in express

res.status(200).json({ message: "Hello world" })

res.json({token});

res.status(500).json('Server Error');

return res.status(400).json({
  errors: errors.array()
});
 
PREVIOUS NEXT
Tagged: #express
ADD COMMENT
Topic
Name
4+3 =