Closed cwoloszynski closed 8 years ago
I have considered this, only problem is that you need to be able to access the instance again, but it's not possible to add a custom variable to the droplet class, so it would be useless to create a provider at the moment. I am looking for other possibilities though
Yes, you are right. I have learned yesterday (from a Slack conversation) that the right approach is to use a Middleware pattern to inject the reference into each request. Provider is not sufficient to do what I was looking to do. I have not yet developed a good solution to configuring the instance using the Vapor configuration tools. That might be just part of the Middleware wrapper I am writing.
You can close this ticket.
Okay! Yeah Providers are mostly used to provide database drivers and middleware, not really a full plugin driver yet :)
I'm looking at this in the context of Vapor and it seems like this is a natural to be used as a Provider.
Have you considered this?