ethanresnick / json-api

Turn your node app into a JSON API server (http://jsonapi.org/)
GNU Lesser General Public License v3.0
268 stars 41 forks source link

Add strategy for hapi #128

Open twbach opened 7 years ago

twbach commented 7 years ago

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

ethanresnick commented 7 years ago

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.

twbach commented 7 years ago

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?

ethanresnick commented 7 years ago

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

snorbi07 commented 6 years ago

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