Skip to content
David Stanley edited this page Dec 7, 2015 · 2 revisions

Starting the Server

This starts the server in development mode. In development mode, the server listens on port 8080 and has more logging. From the root of the project directory, run:

$ npm start

Starting the Server in Production Mode

This starts the server in production mode. In production mode, the server listens over a secure connection on port 443 and has less logging. From the root of the project directory, run:

$ npm run-script production-start

Running in production mode starts the server as a forever dameon that will automatically restart if the server process goes down. The forever npm module is required. Install with $ npm install forever -g

Dev Setup

1. Install

This project uses a Vagrant virtual machine to ensure a homogeneous dev environment and simplify the installation of packages & dependancies. To use vagrant, you must have vagrant and virtual box installed:

Install Vagrant https://www.vagrantup.com/downloads.html

Install Virtual Box https://www.virtualbox.org/wiki/Downloads

Clone this repository to your machine.

2. Start Vagrant

From the root directory of this repository, run:

$ vagrant up

This will create the virtual machine and install all the required packages / dependancies.

Next, run:

$ vagrant ssh

This will start an ssh session into the virtual machine.

Enter the project directory:

$ cd /vagrant

This is a synced directory with the project folder on your host machine. Any changes here will appear on your host machine and vice-versa.

3. Serving & Testing

To start the server, run the following commands in /vagrant on the virtual machine:

$ npm install
$ npm start

To run tests, run:

$ npm install
$ npm test

4. Stopping Vagrant

To stop gracefully, run the following from the project directory on your actual machine (not the virtual machine):

$ vagrant halt

To remove all traces of the Vagrant vm, run:

$ vagrant destroy

Clone this wiki locally