Main api of the conditor-project
The API's goal is to expose deduplicated bibliographical records of "conditor platform".
In order to be fully-functionnal, the API must be able to connect a Conditor Elasticsearch cluster.
This API is coded in NodeJS with ExpressJS framework.
It can be run by different ways :
- Basically, with the
node
CLI - Using forever, via the
npm start
command - With docker, via the
make run-prod
command
Logs are managed with morgan, and written in the $LOG_PATH/conditor-api.log
file
- Node v8+ / NPM5+ (tested with node 8.9.4)
- docker & docker-compose for Docker deployment
git clone https://github.com/conditor-project/api.git
cd api
For native node start or forever start :
npm install
For docker usage
make build
Before launchig the following commands, you must set LOG_PATH
and CONDITOR_ES_HOSTS
environments variables. For example :
export LOG_PATH="$HOME/var/log"
export CONDITOR_ES_HOSTS="localhost:9200"
You can also set other optional environment variables :
export CONDITOR_API_HOST="0.0.0.0"
export CONDITOR_API_PORT="63332"
export REVERSE_PROXY="~"
export JWT_KEY="Secret phrase for generating tokens"
export NODE_ENV="development|production"
For native node start or forever start :
npm start
For development purpose
npm run dev
For docker deployment in production environment
make run-prod
For docker deployment in development/debugging environment
make run-debug
You can of course simultaneously set environment variables and start the API :
LOG_PATH="$HOME/var/log" \
CONDITOR_ES_HOSTS="localhost:9200" \
make run-prod