-
Notifications
You must be signed in to change notification settings - Fork 0
Initial setup
Davide Zanella edited this page May 31, 2019
·
3 revisions
Install the required node.js dependencies by running npm install
in the root folder of the project.
Add the following custom environments variables in order to use servant-api:
- Postgres DB:
-
PGUSER
: postgres username -
PGPASSWORD
: postgres password -
PGHOST
: postgres hostname -
PGPORT
: postgres port -
PGDATABASE
: postgres name of the database
-
- Figure-eight:
-
F8_API_KEY
: the F8 Api key -
F8_BASE_ENDPOINT
: Base endpoint of F8 (https://api.figure-eight.com/v1/)
-
- Yandex toloka:
-
TOLOKA_ACCESS_TOKEN
: Toloka access token -
TOLOKA_BASE_ENDPOINT
: Toloka base endpoint (https://toloka.yandex.ru/api/v1/) -
TOLOKA_SANDBOX_ENDPOINT
: Toloka base endpoint of the sandbox mode (https://sandbox.toloka.yandex.ru/api/v1/)
-
- Amazon Mechanical Turk (not supported yet):
-
AWS_ACCESS_KEY_ID
: mTurk access key id -
AWS_SECRET_KEY
: mTurk secret key -
AWS_REGION
: mTurk region (us-east-1) -
AWS_ENDPOINT
: mTurk base endpoint (https://mturk-requester-sandbox.us-east-1.amazonaws.com)
-
- Google OAuth:
-
GOOGLE_CLIENT_ID
: Google client ID used for authenticating the user
-
Inside the src/db
folder there is a init.sql
file which is needed to recreate the postgres DB.
Simply run npm test
inside the folder or specify a regex as a parameter to execute only specific .spec.js files.
After the whole tests execution jest is set to drop all the active connections to the postgres DB to avoid jest keeping active some background processes and fail on Travis.
Travis is set to execute tests on all branches. In the settings all the env variables are configured.
Heroku hosts the master
and the develop
branches on two different endpoints.