Skip to content
/ api Public
forked from conditor-project/api

🌍 🚀 Main api of the conditor-project

Notifications You must be signed in to change notification settings

Bonvallot/api

 
 

Repository files navigation

api

Main api of the conditor-project

Description

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.

Under the hood

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

Prerequisites

  • Node v8+ / NPM5+ (tested with node 8.9.4)
  • docker & docker-compose for Docker deployment

Installation

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

Usage

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

About

🌍 🚀 Main api of the conditor-project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.2%
  • Makefile 1.8%