JedWatson/node-express-workshop-complete

notes on workshop structure

Opened this issue · 0 comments

  1. I'd start really simple: set up express, create your server, app get homepage and send hello world.

  2. then perhaps introduce morgan and get people to try requesting non-existing pages etc. to see what happens

  3. here's a good point to introduce ejs and views, as we'll need the form element to do post stuff. I'd say give them the views ready made and just explain how to set up ejs with express; there could be an optional stretch goal for doing more advanced stuff with templates e.g. using variables with includes.

  4. app post! start with logging post content to terminal and /or rendering it directly in the view; here is where we need body parser

  5. we want to save our posts so let's set up the database.

  6. writing to database:

    • introduce error handling
    • here is probably a good place to explain next() too :-)
  7. next let's render the post we've just written. perhaps introduce markdown support at this stage

  8. now render all the posts on the index page

  9. help my database is full of crappy test posts! let's see how to reset it.

Additional stuff:
- not having to restart the server every time you make changes to the app would be brilliant; perhaps use something like nodemon.
- I noticed the original express workshop switched from using body parser to formidable; this would make it easier to do image uploading as an optional extra

Hope that helps!

Cheers
I