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

Question: Whats the best way to use express middleware in hapijs #2376

Closed
emcpadden opened this issue Jan 27, 2015 · 5 comments
Closed

Question: Whats the best way to use express middleware in hapijs #2376

emcpadden opened this issue Jan 27, 2015 · 5 comments
Assignees
Labels
support Questions, discussions, and general support

Comments

@emcpadden
Copy link

Hello, I am very new to hapi but I have used express. I would like to switch to hapi but wanted to know if there was a way to use express middleware inside a hapi app. Any blog posts or instructions on the best way to do this would be very much appreciated. I'd prefer a solution where I could wrap the express module so I wouldn't need to modify any of the module source.

@arb
Copy link
Contributor

arb commented Jan 27, 2015

Is there a specific middleware module you wanted to use? It's very unlikely you'll be able to make this work without some level of transformation code.

@hueniverse
Copy link
Contributor

You can't. But most of the use cases are covered using other modules. Just post what you are looking for on hapijs/discuss. I'm sure someone will help you out.

@hueniverse hueniverse self-assigned this Feb 4, 2015
@hueniverse hueniverse added the support Questions, discussions, and general support label Feb 4, 2015
@emcpadden
Copy link
Author

Great, thanks, I was looking into in using Apigee's Volos (https://github.com/apigee-127/volos) libraries which comes with express middleware and I wasn't sure if there was a way to call their middleware in some hapijs plugin wrapper. I've been in touch with them and they had said that HapiJS was something they are considering (see github issue: apigee-127/volos#62) ... I hope they do because I'd rather use HapiJs rather than Express.

@vwal
Copy link

vwal commented Oct 23, 2015

While Apigee's API library might be somewhat of overlap with what Hapi offers natively, take a look at Kong. Putting Kong in front of APIs created with Hapi seems like an excellent idea. Kong is based on NGiNX Openresty, and you'd likely want to have NGiNX in front of your Node (Hapi) app in production anyway.

@emcpadden
Copy link
Author

Great! I'll check it out. Thanks.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

4 participants