Closed gr2m closed 8 years ago
I’ll look into this as I think it’s pretty straight forward and it will let people extend Hoodie Server more easily without limitations
Looking forward to this!!
I’ll look into this as I think it’s pretty straight forward and it will let people extend Hoodie Server more easily without limitations
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hoodiehq/hoodie/issues/528#issuecomment-232969916, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2cWO0td7QV-8k8y5Mgge3o9-bz9zufks5qV5v8gaJpZM4JL-rp .
This is ideal - I've done the dirty and used proxyquire
to replace some basic functions in the short term. This is going to remove the need for plugins for me in the short term, and will get rid of some of my hacks!
at the moment,
require('hoodie')
returns a method that creates a Hapi instance and passes it to the callback: https://github.com/hoodiehq/hoodie/blob/master/server/index.jsThe way we start the Hoodie server at the moment can be seen in bin/start.js
I think it had historical reasons why we ended up with that architecture, and I don’t think it makes much sense any more. Instead, I’d suggest that
require('hoodie')
will return a hapi plugin and that we instantiate a Hapi instance inbin/start.js
instead.That will also make it simple to use Hoodie in existing architectures. And for some people who don’t want to wait for plugins, they can build their own hapi server with custom routes and add hoodie to the mix.
Any thoughts?