0.0.2 • Published 11 years ago
unacademic-api v0.0.2
unacademic-API
This is the repository of the API for the Coding the Humanities unacademic web application.
Up and Running (quick and dirty)
- Fork and clone this repository.
- Move into the repo directory with
cd unacademic-api. - Install dependencies with
npm install. - Run
gruntto begin a watch and lint task. - Run
mocha test/<resource name>(e.g.mocha test/places.js) to run the tests. - Run
node index.jsto start the server.
Setting up local development environment with vagrant
- ensure ansible > 1.8.2, virtualbox and vagrant > 1.7.2 are installed.
npm install.vagrant upnpm run provision-vagrantvagrant 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.33and33.33.33.33/api/0
Setting up staging environment
- 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
Deploying to environment
- commit all required changes to repository
npm run deploy-staging
Seeding the databse
- move to seeding directory
cd seeding
- run yaml to json transformation
-
node prepare_seeds.js3a. seed database if it’s empty: -node seedData.js3b. alternatively, empty database and seed it: -node dropAndSeedData.js