Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create fake request, reply hapi interface for trailpack #42

Open
jaumard opened this issue Aug 11, 2016 · 4 comments
Open

Create fake request, reply hapi interface for trailpack #42

jaumard opened this issue Aug 11, 2016 · 4 comments

Comments

@jaumard
Copy link
Contributor

jaumard commented Aug 11, 2016

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
Copy link
Member

tjwebb commented Nov 19, 2016

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

@jaumard
Copy link
Contributor Author

jaumard commented Dec 17, 2016

@wbprice any ideas on how create this ?

@jaumard
Copy link
Contributor Author

jaumard commented Feb 20, 2017

Up @wbprice :)

@jaumard
Copy link
Contributor Author

jaumard commented Jun 29, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants