trailsjs / trailpack-express

:package: Express Trailpack
MIT License
12 stars 15 forks source link

Create fake request, reply hapi interface for trailpack #42

Open jaumard opened 8 years ago

jaumard commented 8 years ago

In order to have only one interface for embedded controllers and policies, I create trailpack-controller and trailpack-policies that must use hapi interface for request/reply. In order to these component to work with trailpack-express we need to wrap methods of those component and transform express req/res into dummy hapi request/reply. Like this trailpack that use those class can be compatible with hapi and express very easily.

I didn't know how to do this because hapi allow some things like reply().header('key', 'value').redirect('newURL') and I don't know how make something like this with express API.

Any idea ? Any help appreciate ^^

tjwebb commented 7 years ago

@wbprice based on your current Langa project, you might have the most insight here.

jaumard commented 7 years ago

@wbprice any ideas on how create this ?

jaumard commented 7 years ago

Up @wbprice :)

jaumard commented 7 years ago

Maybe https://www.npmjs.com/package/hapi-to-express can help :)