Node.js implementation of the WebSocket status update part of the o2r-web-api.
Requirements:
- nodejs
- npm
- MongoDB
This service uses the MongoDB oplog (operations log), which is normally used in replication sets, to trigger status events for clients. The oplog originally records all changes to the master MongoDB and provides them to potential replications. On a single-server installation, this is not enabled by default, so you will need to enable replication to enable the oplog.
This project includes a Dockerfile
which can be built with
docker build -t informer .
INFORMER_PORT
Define on which Port o2r-informer should listen. Defaults to8082
.INFORMER_MONGODB
Required Connection string for the MongoDB. Defaults tomongodb://localhost:27017/
. You will very likely need to change this.INFORMER_MONGODB_HOST
andINFORMER_MONGODB_PORT
Port for the MongoDB. Defaults tolocalhost
respectively27017
. You will very likely need to change this. This information is duplicated with the previous setting because different packages are used to connect to the MongoDB.INFORMER_MONGODB_DATABASE
Which database inside the mongo db should be used. Defaults tomuncher
.
The current status of a job logs is published using WebSockets using the socket.io library. You can connect to the namespace api/v1/logs/job
with the corresponding Socket.io JavaScript library:
var socket = io('http://<host>/api/v1/logs/job');
See an example in test/index.html
.
o2r-informer is licensed under Apache License, Version 2.0, see file LICENSE.
Copyright (C) 2017 o2r project.