Server-side development is a lot more involved than what we have been doing so far and requires a number of components and software including Node.js and MongoDB (database). You will be using a database in Assignment 3 but not in this lab.
For this class, we will deploy our server-side web application to Heroku. Why use Heroku you may ask? With Heroku, we do not need to worry about the server hardware, server configuration, and server maintenance. Server configuration and maintenance require an extraodinary amount of work --just ask my Web Enginering students what they had to go through when they were thrown into the fire to use Amazon EC2 (part of the Amazon Web Services family, or AWS for short). For a more elaborate discussion on Heroku vs Amazon AWS, see http://stackoverflow.com/questions/9802259/why-do-people-use-heroku-when-aws-is-present-whats-distinguishing-about-heroku.
Use the virtual machine (VM). You will also need to install the Heroku toolbelt on the VM on your own.
If you are a Mac user and choose not to use a virtual machine, install Node.js, Mongo DB, and the Heroku toolbelt via Homebrew:
brew install node mongo heroku-toolbelt.
Install Node.js using directions at https://github.com/nodejs/node-v0.x-archive/wiki/Installing-Node.js-via-package-manager. Then, install MongoDB using directions at https://docs.mongodb.org/manual/administration/install-on-linux/.
nodeto run Node.js (e.g.,
node index.js). On the virtual machine or on Linux, use
nodejsto run Node.js (e.g.,
node-js-getting-startedexample on GitHub: https://github.com/heroku/node-js-getting-started
publicfolder. This static HTML file can be named anything that you want. Modify
index.jsso that it can serves the static HTML file when one accesses the route
/lab8. Example: accessing
https://[YOUR_APP_IDENTIFIER_RANDOMLY_GENERATED].herokuapp.com/lab8on a web browser will render the static HTML file that you created. See https://stackoverflow.com/questions/16593686/what-is-the-best-practice-for-serving-html-in-node-js-with-express-js for more details on how to serve static content with Node.js.
Add me as a collaborator (using my email address
mchow[AT]cs[DOT]tufts[DOT]edu) for your web application in Heroku. You can do this by logging on to Heroku, go to the dashboard for your web application, under "Access", click on the "Add collaborator" button, enter my email address, and click "Save changes".