The OpenTrials API service.
- Node 6.9
- PostgreSQL 9.4
- ElasticSearch 2.3.5
- Copy the
.env.example
file to.env
and alter its contents as needed. At minimum, you should set theDATABASE_URL
andELASTICSEARCH_URL
. TheTEST_DATABASE_URL
is needed to run the tests. You could leave theELASTICSEARCH_AWS_*
as is if you're not using ElasticSearch on AWS; - Run
npm install
; - Run
npm run migrate
; - (Optional) If you want, you can add some seed data using
npm run seed
; - Run
npm run reindex
;
After the install and migrations ran successfully, you can run npm run dev
to
run the project. If you haven't changed the default PORT
, it should be
available at http://localhost:5000
Currently, there's no way to automatically reindex the data. Every time you
change the database, you'd need to run npm run reindex
to keep ElasticSearch
in sync.
You can run the test suite and linting with npm test
.
You can find and interact here with the available endpoints.