http-receiver

1.1.3 • Public • Published

http-receiver

An http endpoint that provides realtime views.

record

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 3000
  • WEB_PORT: the port showing realtime logs, default 8080
  • SIZE: queue size for the cached requests, default 10

Readme

Keywords

none

Package Sidebar

Install

npm i http-receiver

Weekly Downloads

0

Version

1.1.3

License

MIT

Unpacked Size

6.13 kB

Total Files

9

Last publish

Collaborators

  • harttle