Files
Randell Dawson 1494a50123 fix(guide): restructure curriculum guide articles (#36501)
* fix: restructure certifications guide articles
* fix: added 3 dashes line before prob expl
* fix: added 3 dashes line before hints
* fix: added 3 dashes line before solutions
2019-07-24 13:29:27 +05:30

406 B

title
title
Serve JSON on a Specific Route

Serve JSON on a Specific Route


Problem Explanation

It is rather simple to serve a JSON object with Node (at the /json route), if we want to deliver an object containing a key message and with the value "Hello json" we can do so as indicated:

app.get("/json", (req, res) => {
  res.json({
    message: "Hello json"
  });
});