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

feat: expose server over the API #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nestarz
Copy link

@nestarz nestarz commented May 25, 2020

Provide an easy access to the server object allowing to manage it from node.

@lukejacksonn
Copy link
Owner

Nice, out of interest what are managing in node?

@nestarz
Copy link
Author

nestarz commented May 26, 2020

I would like to close the created server and listen to events specified here https://nodejs.org/api/http.html#http_class_http_server

@lukejacksonn
Copy link
Owner

Interesting, it does make the fact that there is no way to terminate the server with the API, glaringly obvious 😅 some way to do that would be good.

Do you think that returning a key { stop: () => server.close() } would suffice, rather than returning the whole server?

@nestarz
Copy link
Author

nestarz commented May 28, 2020

It would be enough for my use case yes ! But maybe add also a key { get: () => server } for any other usecase where we would need the server object (like listening to events) ?
Thanks !

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

Successfully merging this pull request may close these issues.

2 participants