Replies: 2 comments 4 replies
-
Maybe you can try this after changing the routing table: $app->routes->cache(Mojo::Cache->new); You can however change the routing table as much as you want until the first request (iirc), but the order of the routes are significant, so if you have a catch-all route then it must be after the dynamic routes from the database. |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure you're not supposed to change the router after the application starts. Probably why you're using hypnotoad, to restart the app. Honestly if you need that level of dynamism in your routing I'd probably just use a wildcard route and use that to dispatch from your own code |
Beta Was this translation helpful? Give feedback.
-
I have an app that in production runs under hypnotoad, nice and smooth.
I have a small issue with it though. It has two configurations one static (the normal yml file) and one dynamic stored in a DB.
My routing table for the normal users depends on settings in the dynamic config. (when we are in mode A users can access certain routes, mode B other routes etc).
The problem is that the routine table does not update correctly when we change modes using the web app it self.
What is the proper approach to a configuration like this other than physically reloading hypnotoad from the cli?
Beta Was this translation helpful? Give feedback.
All reactions