I will explain my scenario We have some white-labels, and they all will have separate template directory representing their name
For e.g. their templates will be stored in our server in following form */home/whitelabel_1_com/static/template/home/whitelabel_2_com/static/template* So they will be requesting our server from their servers *www.whitelabel_1.comwww.whitelabel_2.com* And on server our Mojolicious code is */home/code/lib/<mojolcious_code>* So when they make a request I need to access config for that particular whitelabel based on the request and create path accordingly and load their corresponding template So that's why added it in before_dispatch as i have access to request and If i am not wrong each will be separate call What can be alternative to my implementation for this scenario? On Friday, 18 July 2014 15:27:25 UTC+8, Abhijit Menon-Sen wrote: > > At 2014-07-17 23:39:16 -0700, [email protected] <javascript:> wrote: > > > > sub before_dispatch { > > my $self = shift; > > my $path = 'abc/xyz/'; > > $self->app->renderer->paths([$path]); # update the renderer path > here > > } > > I bet this will just lead to hard-to-analyse bugs because the change is > not limited to the one request, it'll persist in that process. So in the > next request when you add foo/bar, you'll still also have abc/xyz except > when the request is served by some other process. > > -- ams > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
