Monday, March 16, 2015

Codeschool: Express.js, Part I

The first part of this course overlaps with the previous node.js course, and it's all a pretty gentle exposition of the express API. Some reminders:

  • npm install express@4.9
  • response.send() is the same as response.json() when sending arrays.
  • response.redirect(301,'/parts')
  • place html in /public folder (no use of ejs, yet)
  • response.sendFile(__dirname + '/public/index.html');
  • static middleware: app.use(express.static('public'));
  • what is middleware?

No comments:

Post a Comment