Snippets Collections
app.get('/:character', (req, res) => { // !'/:variable means we return dynamic value
  // * creates a constant which stores return from request parameter character

  const chosen = req.params.character;

  // What does this log?
  // * console logs the above return from request
  console.log(req.params);
  console.log(chosen);
  // * ends function response
  res.json(chosen);
  res.end();
});
star

Fri Dec 04 2020 02:21:51 GMT+0000 (Coordinated Universal Time)

#nodejs,jquery,nodejs #nodejs,jquery

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension