Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Create a new compendium based on existing compendia

License

Notifications You must be signed in to change notification settings

o2r-project/o2r-substituter

Repository files navigation

o2r-substituter

Build Status

Node.js implementation to load compendia from third party repositories and handle direct user uploads for the o2r API.

Currently, it implements the endpoint /api/v1/substitution.

Requirements

  • Node.js >= 6.2
  • npm

Configuration

The configuration can be done via environment variables.

  • SUBSTITUTER_PORT Define on which port substituter should listen. Defaults to 8090.
  • SUBSTITUTER_MONGODB Required Location for the MongoDB. Defaults to mongodb://localhost:27017/. You will very likely need to change this.
  • SUBSTITUTER_MONGODB_DATABASE Which database inside the mongo db should be used. Defaults to muncher.
  • SUBSTITUTER_BASEPATH The local path where compendia are stored. Defaults to /tmp/o2r/.
  • SESSION_SECRET String used to sign the session ID cookie, must match other microservices.

Development & Testing

npm install

# manually start mongodb, o2r-loader, o2r-muncher, and o2r-transporter
npm start

npm test

Dockerfile

The file Dockerfile is the basis for the Docker image published at Docker Hub.

To build and run locally use the following commands to start other required microservices

docker build --tag substituter .

docker run --name mongodb -d -p 27017:27017 mongo:3.4
docker run --name testmuncher -d -p 8080:8080 --link mongodb:mongodb -v /tmp/o2r:/tmp/o2r -v /var/run/docker.sock:/var/run/docker.sock -e MUNCHER_MONGODB=mongodb://mongodb:27017 -e DEBUG=* o2rproject/o2r-muncher:latest
docker run --name testloader  -d -p 8088:8088 --link mongodb:mongodb -v /tmp/o2r:/tmp/o2r -v /var/run/docker.sock:/var/run/docker.sock -e LOADER_MONGODB=mongodb://mongodb:27017 -e DEBUG=* loader

docker run --name testsubstituter -it -p 8090:8090 --link mongodb:mongodb -v /tmp/o2r:/tmp/o2r -e SUBSTITUTER_MONGODB=mongodb://mongodb:27017 -e DEBUG=* substituter

License

o2r-substituter is licensed under Apache License, Version 2.0, see file LICENSE.

Copyright (C) 2017 - o2r project.

About

Create a new compendium based on existing compendia

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages