json-api icon indicating copy to clipboard operation
json-api copied to clipboard

Add strategy for hapi

Open twbach opened this issue 7 years ago • 4 comments

I wonder if it would also be possible to implement a strategy for hapi or if there is already a solution available.

twbach avatar Mar 17 '17 09:03 twbach

Adding a hapi strategy should be pretty easy, but I don't have time to work on it personally right now. If you want to take a crack at it, using the express and koa strategies as guides, I'm happy to answer any questions.

ethanresnick avatar Mar 17 '17 22:03 ethanresnick

Thanks, I created it based on the express strategy and it works so far.

It was indeed relatively simple, but I am not really happy with my solution. For example, I had a problem with parsing the body, because it was already been parsed by hapi. My solution was to add another argument to the buildRequestObject function and another if-statement. I don't know how to do it better yet. Should I create a pull request anyway?

twbach avatar Mar 18 '17 18:03 twbach

Glad you got it working. And yeah, please create a pull request and I'll take a look!

ethanresnick avatar Mar 19 '17 05:03 ethanresnick

Any news on the Hapi strategy PR @twbach? Thanks!

snorbi07 avatar Apr 13 '18 09:04 snorbi07