Closed jamesdixon closed 6 years ago
It's coming :) As you've seen haute-couture is just about to land in https://github.com/devinivy/haute-couture/pull/36, at which point the upgrade on this repo should be pretty straightforward. Upgrading the flavors will take a little more time. If you want to take a crack at any of it, feel free! I will probably work on it tomorrow and Sunday.
suh-weet! I actually was taking a crack at updating labbable last night, but the tests were throwing me for loop because of the whole async/await flow.
This is a bit of a side conversation that I'd be happy to take to slack/gitter/email or an issue on the labbable repo, but I wasn't planning on upgrading labbable since it's so much easier to asynchronously return a server using async/await than using callbacks, so the module is a lot less useful than before. That said, I would certainly publish an upgrade, and I'm open to different perspectives on it. Here's the boilerplate code I'm imagining (from this thread),
module.exports = (async () => {
const server = await Glue.compose(manifest);
await server.initialize();
if (module.parent) {
return server;
}
await server.start();
console.log(`Server started at ${server.info.uri}`);
return server;
})();
@devinivy I gave this a shot, but not having any luck including it in tests via server = await require('../server');
. Let me know if you have a moment to chat on Slack hapi hour
@devinivy nix that. I had forgotten to change return;
to return server;
. Works as expected. Thanks!
As for upgrading labbable, do you think it's worth adding this snippet to the docs to point out there is a better way going forward?
Yes, but I'd like to play with the snippet a bit more first– it probably needs a little more work to handle failures properly.
Here's what I've come-up with so far, open to feedback https://github.com/devinivy/boilerplate-api/pull/45
@devinivy I'll take a look as soon as I get my project completely ported to v17. Looking forward to trying this out!
Resolved by #45
heyo!
now that h17 is out, i was thinking about starting from the boilerplate and re-structuring my application a bit using this boilerplate. any thoughts on h17 compatibility?
cheers, james