Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
| var big = require('../../index'); | |
| var debug = require('debug')('big::sink'); | |
| var http = require('resource-http'); | |
| var mesh = require('resource-mesh'); | |
| module['exports'] = function sink (opts) { | |
| opts = opts || {}; | |
| opts.port = opts.port || 8888; | |
| opts.site = opts.site || {}; | |
| opts.site.root = opts.site.root || __dirname + "/public"; | |
| big.start(opts, function(err, app){ | |
| // start static http server | |
| http.listen({ | |
| port: 9998, | |
| root: opts.root | |
| }, function(err, app) { | |
| if (err) { | |
| throw err; | |
| } | |
| var addr = app.server.address(); | |
| // on any event, emit it as JSON to STDOUT for logging streams to capture | |
| mesh.emitter.onAny(function(data){ | |
| debug(JSON.stringify({ event: this.event, data: data }) + '\n') | |
| }); | |
| }); | |
| }); | |
| return big; | |
| }; | |