notes on workshop structure
Opened this issue · 0 comments
-
I'd start really simple: set up express, create your server, app get homepage and send hello world.
-
then perhaps introduce morgan and get people to try requesting non-existing pages etc. to see what happens
-
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.
-
app post! start with logging post content to terminal and /or rendering it directly in the view; here is where we need body parser
-
we want to save our posts so let's set up the database.
-
writing to database:
- introduce error handling
- here is probably a good place to explain next() too :-)
-
next let's render the post we've just written. perhaps introduce markdown support at this stage
-
now render all the posts on the index page
-
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