-
Notifications
You must be signed in to change notification settings - Fork 399
Open
Labels
status: awaiting answerAwaiting answer from the author of issue or PR.Awaiting answer from the author of issue or PR.type: discussionIssues discussing any topic.Issues discussing any topic.type: featureIssues related to new features.Issues related to new features.
Description
Hi,
I have routing-controllers over Express server.
I inject services to the controllers, and I wonder if there is a way to create a service per HTTP request?
A more concrete example: I have a cache service that store data based on the locale of the request.
In order to get the right locale I need to somehow get the the locale from the request.
I'd like to avoid manually sending the request every time I execute GET / SET / DEL.
I thought about creating a middleware , inject the service the service there and manually set the active request there. To do that however, I need some way to create a service per request to make sure there will be no collision between requests.
Do you have any idea how can I achieve this?
Metadata
Metadata
Assignees
Labels
status: awaiting answerAwaiting answer from the author of issue or PR.Awaiting answer from the author of issue or PR.type: discussionIssues discussing any topic.Issues discussing any topic.type: featureIssues related to new features.Issues related to new features.