Skip to content

Instantly share code, notes, and snippets.

Last active Jul 24, 2017
What would you like to do?
const newResponse = (status_code, header, body) => {
return { status_code, header,
body: Buffer.from(JSON.stringify(body) || '').toString('base64')
module.exports = function (got) {
const inData =;
console.log('edig: simple.js: data received:', inData);
return => {
let req = JSON.parse(d.value);
console.log(`${req.method}: ${req.request_uri}`);
let res = newResponse(200, {'Content-Type': ['text/plain; charset=utf-8']}, 'Nice one!');
return {
name: 'api_rpc',
key: d.key,
value: res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment