@nkbt/geovis-mock
v1.1.3
Published
Mock to feed GeoVis server with data
Downloads
3
Readme
geovis-mock
Mock to feed GeoVis server with data
Installation
npm install --global @nkbt/geovis-mock
Usage
Running mock
CLI
> WS_HOST=localhost WS_PORT=10000 geovis-mock
API
const {run} = require('@nkbt/geovis-mock');
const {
WS_HOST = 'localhost',
WS_PORT = 10000
} = process.env;
run({WS_HOST, WS_PORT});
Logging
06:38 $ ./bin.js
connecting to ws://localhost:10000...
connected
>> {"action":"GEO_BROADCAST","payload":[{"srcLat":55.751244,"srcLon":37.618423,"dstLat":49.246292,"dstLon":-123.116226,"value":3}]}
>> {"action":"GEO_BROADCAST","payload":[{"srcLat":50.411198,"srcLon":30.446634,"dstLat":55.751244,"dstLon":37.618423,"value":4}]}
>> {"action":"GEO_BROADCAST","payload":[{"srcLat":-33.865143,"srcLon":151.2099,"dstLat":-12.462827,"dstLon":130.841782,"value":6}]}
disconnected
Development and testing
Currently is being developed and tested with the latest stable Node 6
under OSX
.
git clone [email protected]:nkbt/geovis-mock.git
cd geovis-mock
npm install
Tests
# to run tests
npm test
# to generate test coverage (./coverage)
npm run cov
License
MIT