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
nodeCLI - Using forever, via the
npm startcommand - With docker, via the
make run-prodcommand
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 apiFor native node start or forever start :
npm installFor docker usage
make buildBefore 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 startFor development purpose
npm run devFor docker deployment in production environment
make run-prodFor docker deployment in development/debugging environment
make run-debugYou can of course simultaneously set environment variables and start the API :
LOG_PATH="$HOME/var/log" \
CONDITOR_ES_HOSTS="localhost:9200" \
make run-prod