4 ms·
+1 for InversifyJS from me too. I've also been looking at the inversify express utils lately -- loving it so far! Do you know if there are any plans for allowi
by dvlsg 9y ago
+1 for InversifyJS from me too. I've also been looking at the inversify express utils lately -- loving it so far!
Do you know if there are any plans for allowing the http context (req, namely) to be injected into services? Similar to the IHttpContextAccessor in dotnet core?
I have some use cases for using pieces of the http context (headers) to instantiate some transient services. I started putting together my own pieces to see what I could get away with. Looks like it works okay, but I had to create a new container per request, using the `Container.parent` to link them.
- remojansen 9y agoThis should be possible now. You can implement by yourself as described at https://twitter.com/RemoHJansen/status/927542673682116611 https://twitter.com/RemoHJansen/status/927542673682116611. I have already started to think about a way to add this into the inversify-express-utils but I have to think it well so it can support all kinds of auth.
- ower89 9y agoHttpContext is now available in inversify-express-utils@4.2.2 https://github.com/inversify/inversify-express-utils#httpcontext https://github.com/inversify/inversify-express-utils#httpcon... :)