Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access to http server instance #127

Open
afoninsky opened this issue Aug 29, 2016 · 4 comments
Open

access to http server instance #127

afoninsky opened this issue Aug 29, 2016 · 4 comments

Comments

@afoninsky
Copy link

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)

@mcdonnelldean
Copy link
Contributor

@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

@benbonnet
Copy link

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) ?

@vladholubiev
Copy link

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 ?

@vladholubiev
Copy link

vladholubiev commented Dec 1, 2016

@bbnnt I looked at the sources, and found you can call /act?role=seneca&cmd=stats to do a health check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants