##What? A quick lesson in serverside javascript. Creates a super basic blog that gets and posts via AJAX and saves to a JSON file. Demonstrates many important web development concepts. After finishing the project get students to talk about how they would implement other features like editing posts and basic security.
##Features
- posts.json holds all the posts, students can see just how data is stored and can edit it manually.
- jquery handles ajax requests for geting and posting blog posts.
- post form is initially hidden, shows when there is a
location.search
like ?admin - handlebars handles templates for super simple templating, just two lines of JS and the templates are written in HTML
##Setup
cd ~/workspace
- Copy
blogServer.js
here (~/workspace) mkdr blog
- Copy all files except blogServer.js to ~/workspace/blog
npm install express body-parser
##Running
- Stop any running servers
cd ~/workspace
node blog/blogServer.js
- If a popup tells you you need to kill running processes, kill them, usually by pressing a green button that pops up.
- Navigate to your workspace's webserver root url. IE http://itsgreggreg-github-io-itsgreggreg2.c9.io not http://itsgreggreg-github-io-itsgreggreg2.c9.io/blog/index.html