in reply to CSS and PSGI

You will need to configure Plack to serve up static files - there is a good tutorial in the Plack Advent Calendar - see Day 17: Serving static files from your application. It has a few examples.

If you reference your CSS file as "/static/funky.css" in your template, then this should work:

use Plack::Builder; my $app = sub { ... }; builder { enable "Static", path => qr!^/static!, root => '/Library/WebServer +/Documents'; $app; }
Update: minor edits

Replies are listed 'Best First'.
Re^2: CSS and PSGI
by Anonymous Monk on Aug 19, 2015 at 14:28 UTC

    tangent, thank you for suggesting a solution. I am a bit, embarrassed for I am not familiar yet with the Perl lingo. I'm afraid that I may have to ask for a little clarification. Does the suggested code have to be run in a new .psgi file? or should I just add the code you suggested to the .psgi file I originally created? Also, what does the 3 dots in the my $app = sub { ...}; mean? Is that also part of the code that I should just write in verbatim? Thank you for being patient.

      Certainly no need to be embarassed, how else do we learn but by asking questions? I could have been a bit clearer too! You just need to add the code to your existing file, the my $app = sub { ... }; is a placeholder for what you have already. The important thing is to put the 'builder' part at the very end, so:
      use strict; use warnings; use diagnostics; use Template; use Plack::Builder; my $app = sub { my $html = get_html(); # etc }; sub get_html { # etc } builder { enable "Static", path => qr!^/static!, root => '/Library/WebServer +/Documents'; $app; }

        tangent, thank you for leading me in the right direction. The code you gave me worked with a little adjustment. I tweaked the regex part in order to conform with the second code found in the advent tutorial you mentioned.

        builder { enable "Static", path => sub { s!^/static/!! }, root => '/Library/ +WebServer/Documents'; $app; }

        I found the code you originally suggested in the same tutorial. Thank you for taking the time. For some reason unknown to me, it needed to be tweaked a little bit. Thanks again and kudos!