Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Static web site from Dancer via Wallflower
#!/usr/bin/env perl
use Dancer;
use File::Copy;
use Wallflower;
use My::App;
my $app = sub {
my $env = shift;
my $request = Dancer::Request->new ( env => $env );
Dancer->dance ( $request );
};
my $wf = Wallflower->new ( application => $app, destination => 'static' );
$wf->get( $_ ) for qw( /sitemap /sitemap.xml / ), map { "/$_.html" } qw( page1 page2 ... );
rename 'static/sitemap' => 'static/sitemap.html';
copy ( "public/images/favicon.ico", "static/favicon.ico" ) or die "Copy failed: $!";
print "# lighttpd -D -f static/lighttpd.conf\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.