This is the repository of the API for the Coding the Humanities unacademic web application.
- Fork and clone this repository.
- Move into the repo directory with
cd unacademic-api
. - Install dependencies with
npm install
. - Run
grunt
to begin a watch and lint task. - Run
mocha test/<resource name>
(e.g.mocha test/places.js
) to run the tests. - Run
node index.js
to start the server.
- ensure ansible > 1.8.2, virtualbox and vagrant > 1.7.2 are installed.
npm install
.vagrant up
npm run provision-vagrant
vagrant ssh
- inside the vagrant box, run
cd /home/deploy/unacademic/
pm2 start index.js
- when necessary, reload the server with
pm2 reload all
- view logs of pm2 with
pm2 logs
- visit browser
33.33.33.33
and33.33.33.33/api/0
- create a box on digitalocean and change the root password through SSH
- configure the ip adress in
devops/inventories/staging.yml
npm run provision-staging
- commit all required changes to repository
npm run deploy-staging
- move to seeding directory
cd seeding
- run yaml to json transformation
node prepare_seeds.js
3a. seed database if itβs empty:node seedData.js
3b. alternatively, empty database and seed it:node dropAndSeedData.js