traveler has asked for the wisdom of the Perl Monks concerning the following question:
Here is my Dancer2 config.ymlDocumentRoot /var/webapps/sandbox/public <FilesMatch "\.(?:cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "/var/webapps/sandbox/public"> Options +Indexes +FollowSymLinks +MultiViews +ExecCGI AddHandler cgi-script .cgi AllowOverride None Require all granted SSLOptions +StdEnvVars </Directory> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /dispatch.cgi$1 [QSA,L] # ScriptAlias / /var/webapps/sandbox/public/dispatch.cgi/ <Location /> # Set up your Dancer2 application SetHandler cgi-script AddHandler application/x-httpd-perl .cgi PerlSetEnv Dancer2_APP /var/webapps/sandbox/bin/app.pl PerlSetEnv DANCER2_CONFDIR /var/webapps/sandbox PerlSetEnv DANCER_CONFDIR /var/webapps/sandbox PerlSetEnv DANCER2_ENV development </Location>
Here is a code snippet:# Your application's name appname: "sandbox" # We want to keep session data around so engines: session: YAML: session_dir: /tmp/dancer-sessionstore engines: template: template_toolkit: start_tag: '<%' end_tag: '%>' template: "template_toolkit" session: YAML # The default layout to use for your application (located in # views/layouts/main.tt) layout: "main" # when the charset is set to UTF-8 Dancer2 will handle for you # all the magic of encoding and decoding. You should not care # about unicode within your app when this setting is set (recommended) +. charset: "UTF-8" # template engine # simple: default and very basic template engine # template_toolkit: TT # template: "simple" plugins: Database: driver: 'mysql' database: 'vlabs' host:'something' port: 3306 username: 'rouser' password: 'xxxxxxxxxx' connection_check_threshold: 10
And the log snippet:debug "displaying login page"; template 'login.tt', { path => param('requested_path') }; debug "showed login page";
There is a main.tt and a login.tt in the correct places. I get no output in my browser. The page is empty even when I look at the page source. (I do see the favicon.ico.) I am stumped, monks. Any ideas? TIA[sandbox:12160] debug @2025-04-05 15:07:00> displaying login page in / +var/webapps/sandbox/public/../lib/sandbox.pm l. 45 [sandbox:12160] debug @2025-04-05 15:07:00> showed login page in /var/ +webapps/sandbox/public/../lib/sandbox.pm l. 47
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why won't my Dancer2 app render any output???
by hippo (Archbishop) on Apr 06, 2025 at 09:59 UTC | |
by traveler (Parson) on Apr 06, 2025 at 14:23 UTC | |
Re: Why won't my Dancer2 app render any output???
by 1nickt (Canon) on Apr 06, 2025 at 19:28 UTC | |
by traveler (Parson) on Apr 06, 2025 at 21:06 UTC | |
by 1nickt (Canon) on Apr 06, 2025 at 23:27 UTC | |
by traveler (Parson) on Apr 07, 2025 at 02:23 UTC | |
by 1nickt (Canon) on Apr 07, 2025 at 10:19 UTC | |
by 1nickt (Canon) on Apr 06, 2025 at 23:20 UTC | |
by traveler (Parson) on Apr 06, 2025 at 23:25 UTC |