http-receiver
v1.1.3
Published
An http endpoint that provides realtime views
Downloads
12
Readme
http-receiver
An http endpoint that provides realtime views.
Get Started
Copy the following code into your page:
<script>
window.rlog = window.remoteLog = function () {
var text = Array.prototype.slice.call(arguments).map(function (arg) {
return typeof arg === 'object' ? JSON.stringify(arg) : arg;
}).join(' ');
var img = document.createElement('img');
img.src = 'receiver.harttle.com/?text=' + encodeURIComponent(text);
};
rlog('foo', '我爱你中国', {foo: 'bar'}); // send anything using rlog
</script>
Checkout http://log.harttle.com for your log.
Host Yourself
The receiver is a Node.js-based server and available on npm:
npm i -g http-receiver
PORT=8080 http-receiver
Send log to http://localhost:3000 and checkout http://localhost:8080 for your log.
Environments
REC_PORT
: the port to receive data, default 3000WEB_PORT
: the port showing realtime logs, default 8080SIZE
: queue size for the cached requests, default 10