WebFund 2013W: Task 2: Difference between revisions

From Soma-notes
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
Your task for this set of tutorials are as follows:
Your task for this set of tutorials are as follows:
* Choose a partner or partners, form a team.
* Choose a partner or partners, form a team.
* Setup a team in github with the help of a TA or instructor.
* Setup a team in github with the help of a TA or instructor.  You need your github usernames and a team name.
* Try the tutorial for making a simple blog.  The tutorial is [http://howtonode.org/express-mongodb here].
* Try the tutorial for making a simple blog.  The tutorial is at [http://howtonode.org/express-mongodb howtonode.org/express-mongodb].


==Simple Blog tutorial==
==Simple Blog tutorial==


The tutorial needs administrative access.  In the lab, you can go to VirtualBox, run the COMP 3004 VM, and login as user "admin" with the password "nimda!".
The tutorial needs administrative access.  In the lab, you can go to VirtualBox, run the COMP 3004 VM, and login as user "admin" with the password "nimda!".  We suggest running this VM in full-screen mode and accessing the web from within the VM.  This way, files that you download will be easily accessible.


Do not expect to understand much of what you will be doing in this tutorial at first.  We will be explaining pieces of this code in the upcoming weeks.  Think of this more as a way to see what a simple node web application will look like.
Do not expect to understand much of what you will be doing in this tutorial at first.  We will be explaining pieces of this code in the upcoming weeks.  Think of this more as a way to see what a simple node web application will look like.


This tutorial is against an older version of the packages.  A working version with bugs fixed, including all the functionality up to the comments part (i.e., in includes basic MondoDB functionality) is [http://homeostasis.scs.carleton.ca/~soma/webfund-2013w/blog.zip here].  To get it running in the lab VMs do the following commands.
This tutorial is against an older version of the packages.  The comments at the end of the tutorial can help you fix the bugs (particularly the first one).
 
Alternately, a working version with bugs fixed, including all the functionality up to the comments part (i.e., in includes basic MondoDB functionality) is [http://homeostasis.scs.carleton.ca/~soma/webfund-2013w/blog.zip here].  To get it running in the lab VMs do the following commands.


To get node and mongo DB installed:
To get node and mongo DB installed:
Line 17: Line 19:
  sudo apt-get update
  sudo apt-get update
  sudo apt-get install nodejs npm nodejs-dev mongodb
  sudo apt-get install nodejs npm nodejs-dev mongodb
  sudo npm install express -g  (from the tutorial)
  sudo npm install express -g  # from the tutorial


Then:
Then:
  wget http://homeostasis.scs.carleton.ca/~soma/webfund-2013w/blog.zip
  wget http://homeostasis.scs.carleton.ca/~soma/webfund-2013w/blog.zip
  unzip blog.zip
  unzip blog.zip
  cd blog.zip
  cd blog
  npm install -d
  npm install -d
  node simple-express.js
  node simple-express.js
Line 34: Line 36:
  node app-mondo.js
  node app-mondo.js


These are on localhost:3002 by default.
These are on localhost:3002 by default.  By default the mondo version won't have any posts; to add one, visit http://localhost:3002/blog/new .


Good luck!
Good luck!

Latest revision as of 15:33, 21 January 2013

Your task for this set of tutorials are as follows:

  • Choose a partner or partners, form a team.
  • Setup a team in github with the help of a TA or instructor. You need your github usernames and a team name.
  • Try the tutorial for making a simple blog. The tutorial is at howtonode.org/express-mongodb.

Simple Blog tutorial

The tutorial needs administrative access. In the lab, you can go to VirtualBox, run the COMP 3004 VM, and login as user "admin" with the password "nimda!". We suggest running this VM in full-screen mode and accessing the web from within the VM. This way, files that you download will be easily accessible.

Do not expect to understand much of what you will be doing in this tutorial at first. We will be explaining pieces of this code in the upcoming weeks. Think of this more as a way to see what a simple node web application will look like.

This tutorial is against an older version of the packages. The comments at the end of the tutorial can help you fix the bugs (particularly the first one).

Alternately, a working version with bugs fixed, including all the functionality up to the comments part (i.e., in includes basic MondoDB functionality) is here. To get it running in the lab VMs do the following commands.

To get node and mongo DB installed:

sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm nodejs-dev mongodb
sudo npm install express -g  # from the tutorial

Then:

wget http://homeostasis.scs.carleton.ca/~soma/webfund-2013w/blog.zip
unzip blog.zip
cd blog
npm install -d
node simple-express.js

This should get you hello world on localhost:3000.

To run the in-memory version, run:

node app-memory.js

To run the mondo DB version:

node app-mondo.js

These are on localhost:3002 by default. By default the mondo version won't have any posts; to add one, visit http://localhost:3002/blog/new .

Good luck!