seneca-transport
seneca-transport copied to clipboard
access to http server instance
Server instance created in local scope, not accessible by my code: https://github.com/senecajs/seneca-transport/blob/master/lib/http.js#L23
Can we extend http server (or append ability to pass it via config, or do whatever else according your module rules)?
Usecase: i want to pass socket into my favorite http framework (express/hapi/koa) and setup health-check routes (example for google: "GET /_ah/health" tells google what my microservice is alive)
@afoninsky We'd definitely be open to a PR on this. seneca.export
can be used to cleanly export named functions and objects from plugins; see: https://github.com/senecajs/seneca/blob/master/test/plugin.test.js#L32
not that experienced yet to extending seneca; but interested in this feature (providing health check for the service); what would be the simplest approach (two url would be needed) ?
Same question as @bbnnt , is what is the recommended way for health check? Just seneca.add(role: health, cmd: check)
or does seneca have something built-in already @mcdonnelldean ?
@bbnnt I looked at the sources, and found you can call /act?role=seneca&cmd=stats
to do a health check