What can you do in the before hook? - Where is the documentation?
Hi, I was looking to set a catch-all route that will show "site is closed" and reached https://metacpan.org/pod/Dancer#hook specifically the hook before => sub { construct. It says what does the sub receive but it does not say what can one do with it. If the return value matters, etc. I am wondering if such documentation exists and if it would be a good idea to include it here or to link to it? Gabor
On 3/27/2014 10:08, Gabor Szabo wrote:
I was looking to set a catch-all route that will show "site is closed
It is usually better to do such things in your reverse proxy or load balancing layers, because one of the reasons the site can be closed is that the web app is not running. For example, if you're putting nginx in front of Dancer, you'd want to have an alternate configuration set up that let you switch the Dancer proxy stuff out for static content that appears no matter what URL was given on the site.
On Fri, Mar 28, 2014 at 5:26 PM, Warren Young <warren@etr-usa.com> wrote:
On 3/27/2014 10:08, Gabor Szabo wrote:
I was looking to set a catch-all route that will show "site is closed
It is usually better to do such things in your reverse proxy or load balancing layers, because one of the reasons the site can be closed is that the web app is not running.
For example, if you're putting nginx in front of Dancer, you'd want to have an alternate configuration set up that let you switch the Dancer proxy stuff out for static content that appears no matter what URL was given on the site.
I think you are right in a "normal" situation, but in my case I just have a Starman instance running this thing. An internal app which is in development. Of course I could have a separate app.psgi file just to show "site is closed". That's probably what I am going to do. Thanks. Nevertheless, the question still stands: What can one do in the before hook and where is that documented? Gabor
participants (2)
-
Gabor Szabo -
Warren Young