Skip to content

Installation

Mark Moffat edited this page Oct 7, 2020 · 2 revisions

Note: Node.js version 10.x or greater is needed.

  1. Create a folder to hold your installation: mkdir expressCart
  2. FTP/Copy the contents of the zip to your newly created folder
  3. Enter folder: cd expressCart
  4. Install dependencies: npm install
  5. Start application: npm start --production
  6. Visit http://127.0.0.1:1111 in your browser

Keeping expressCart running after closing the terminal can be done in a few ways but we recommend using the PM2 package. To set this up:

  1. Install PM2: npm install pm2 -g
  2. Add expressCart to PM2: NODE_ENV=production pm2 start app.js --name expressCart
  3. Check PM2 has our app: pm2 list
  4. Save the PM2 config: pm2 save
  5. To start/stop: pm2 start expressCart / pm2 stop expressCart

Docker

The easiest way to get up and running is using Docker. Once the Docker CLI is installed from https://www.docker.com/get-docker.

  1. Enter the root of the expressCart application
  2. Change /config/settings.json - "databaseConnectionString": "mongodb://mongodb:27017/expresscart"
  3. Run: docker-compose up --build
  4. Visit http://127.0.0.1:1111 in your browser
  5. Optional. To install test data run the following
  • docker exec -it expresscart bash
  • npm run testdata
  • exit

Deploy on Heroku

Deploy

Note: When deploying to Heroku you will need to configure your external MongoDB either on your own server or a hosted service on mLab, AWS etc.

Clone this wiki locally