hapijs / glue

Server composer for hapi.js
Other
245 stars 62 forks source link

add support for preConnection and preRegister options handlers #3

Closed csrl closed 9 years ago

csrl commented 9 years ago

It would be useful to pass function handlers in the Glue.compose() options in order to manipulate the server at each stage. Example:

var Glue = require('glue');
var options = {
  relativeTo: __dirname,
  preConnection: function (server, next) {
     next();
  },
  preRegister: function (server, next) {
     server.app.shared = someValue;
     next();
  },
};
Glue.compose(require("./manifest.json"), options, function (err, server) {
  server.start();
});

The idea being that it would be possible to set up the server prior to loading plugins.

Is this something you'd consider supporting?

Thanks.

hueniverse commented 9 years ago

glue's main use case is the rejoice command line utility. Since rejoice works off json files, passing functions is not possible. I personally don't have an objection to this idea but I would not be adding any additional features. It's time for some else to take over this module and drive it forward.

csrl commented 9 years ago

@hueniverse

I've generated a series of patches:

https://github.com/csrl/glue/compare/hapijs:master...master

If it looks interesting to you, I can create a pull request. Or if you'd like something changed (compose option names?) let me know.

hueniverse commented 9 years ago

@csrl would you like to take over this module as lead maintainer?

csrl commented 9 years ago

I've read through hapi's governance doc. Given this module's limited scope and my own need/use of it, I expect I can commit to the potential time requirements.

Thank you for considering me. I accept.

hueniverse commented 9 years ago

What's your npm account?

csrl commented 9 years ago

newly minted: csrl

hueniverse commented 9 years ago

@csrl I sent an email to the address listed with a question...

hueniverse commented 9 years ago

You now have npm publish rights as well as contrib rights on the repo. Please read the documents at hapijs/contrib as well as hapijs/hapi/docs to understand the workflow. The most important parts are to make sure every issue is labeled, if you are working on something or taking action as maintainer (even just closing a question) assign it to yourself, and to manage milestones carefully.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.