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

Integrate with awilix-router-core #5

Closed
jeffijoe opened this issue Nov 10, 2017 · 4 comments
Closed

Integrate with awilix-router-core #5

jeffijoe opened this issue Nov 10, 2017 · 4 comments

Comments

@jeffijoe
Copy link
Owner

Hey @talyssonoc — I've been working on a routing abstraction to make routing + dependency resolution super streamlined. The core package is awilix-router-core which does not cater to any specific HTTP framework.

Here's an example usage and reference implementation I did for the awilix-koa package.

All the builder + decorator stuff resides in awilix-router-core, all you need to do is register the result with app.get|post|... as seen in the reference implementation.

Would you be willing to work on this? If you need any help or if something could be more clear, please let me know.

Thanks again for maintaining awilix-express! 😄

@talyssonoc
Copy link
Collaborator

Hello @jeffijoe, I really liked the idea of awilix-router-core! It's good to have a base like that to build integrations on. I'm gonna work on that soon, thanks for the heads up!

@jeffijoe
Copy link
Owner Author

Excellent, let me know if you get stuck. 😄

Also, you'll have to set the awilix peerDependency + devDependency to "awilix": ">=2.11.1 <3.0.0", as container.build was introduced in 2.11. Relevant docs on container.build() here.

@talyssonoc
Copy link
Collaborator

Hey @jeffijoe, sorry for the delay on that. I'm working on it and got stuck in the after decorator. Express doesn't support to set new headers after the body is already sent so the controller tests are failing. Do you think it would be better to not expose the after in awilix-express or change the test to something that is possible with express?

@jeffijoe
Copy link
Owner Author

Feel free to make the tests more Express-friendly. 😄

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

No branches or pull requests

2 participants