Public | Automated Build

Last pushed: 10 months ago
Short Description
Node.js implementation to serve data according to o2r-web-api
Full Description

o2r contentbutler - DEPRECATED, use o2r-transporter

Node.js implementation of the /api/v1/compendium/:id/data and /api/v1/job/:id/data resources in the o2r web api.


Besides Node.js (>= 6.x), this project requires the ImageMagick tool convert.


The configuration can be done via environment variables.

    Define on which port the service should listen. Defaults to 8081.
    Location for MongoDB. Defaults to mongodb://localhost/.
    Which database inside the mongo db should be used. Defaults to muncher.
    Base path for the compendia storage. Defaults to /tmp/o2r.
    String used to sign the session ID cookie, must match other microservices' configurations.

Run locally

mkdir mongodbdata
mongod --dbpath ./.mongodbdata

npm install
npm start

Open the application at http://localhost:8081/api/v1/compendium/1234/test

To show logs in the console, replace the last command with DEBUG=* npm start. There you can also see if requests are handled while not having any real data yet.

To add some content to your local database, use o2r-muncher.

Inspect your local MongoDB with adminMongo.

Debug locally

npm run-script debug

The start statement in this script sets the DEBUG variable for the debug library to * (show all logs).
Direct the log into a file using DEBUG=* npm start > log.txt.


Tests need a completely new environment (empty database), which is preferably started with the docker-compose file docker-compose.yml. The Docker compose configuration also pulls the latest contentbutler from Docker Hub, but we can just ignore that for our local tests.

npm install
npm install -g mocha
docker-compose up -d
sleep 10
npm test
docker-compose down -v


The file Dockerfile describes the Docker image published at Docker Hub.


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

Copyright (C) 2017 - o2r project.

Docker Pull Command
Source Repository