SPS | Shootmail
SPS | Shootmail
Explore posts from servers
HHono
Created by SPS | Shootmail on 12/3/2024 in #help
Context is not available, context storage middleware
Probably i can use a dependency injection framework like tsyringe but that looks like overkill to me.
9 replies
HHono
Created by SPS | Shootmail on 12/3/2024 in #help
Context is not available, context storage middleware
But this was, if i implement the MVC architecture, all the methods of the model layer are dependent on the variable that contains the db.
9 replies
HHono
Created by SPS | Shootmail on 12/3/2024 in #help
Context is not available, context storage middleware
Thanks for replying. Yes i use context variable map. My concern was how to init the db using env vars outside of the route methods. I misunderstood the context storage. I thought, the context storage will be available outside the route chain but that's not the case. So i am setting db in variables in a middleware and accessing it in the controllers.
9 replies
HHono
Created by SPS | Shootmail on 12/3/2024 in #help
Context is not available, context storage middleware
In TemplatesController, I call TemplatesService that initializes db in the constructor.
9 replies
HHono
Created by SPS | Shootmail on 5/9/2024 in #help
App breaks in RPC mode, works normally
This was happening because one of my controller methods was not returning from all code paths. This is working now, but is this intended?
3 replies