RSS Git Download  Clone
Raw Blame History
#!/usr/bin/env perl

use feature 'say';
say "Perl version: $^V";

use strict;
use warnings;

use FindBin;
# use Devel::Confess 'color'; # to get full stacktrace instead of "eval nnn line nnn" in console; using 'traces' in .yml now
use Plack::Builder;

use lib "$FindBin::Bin/../lib";
use DocsLib;

builder {
	enable 'ReverseProxy'; # or set behind_proxy: 1 in app's D2 config

	mount '/docs-lib' => DocsLib->to_app; # for deployment
	mount '/'         => DocsLib->to_app; # for dev
}

=begin # use this block if you don't need middleware, and only have a single target Dancer app to run here
Routes->to_app;
=cut

=begin comment
# use this block if you want to include middleware such as Plack::Middleware::Deflater
builder {
	enable 'Plack::Middleware::AccessLog', # disable default using "plackup --no-default-middleware"
		# format => '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"';
        format => '%t "%r" %>s %b "%{Referer}i"';
	enable 'StackTrace'; # if switched off using "plackup --no-default-middleware"
	enable 'Lint';       # if switched off using "plackup --no-default-middleware"
    Routes->to_app;
}
=cut

=begin comment
# use this block if you want to mount several applications on different path

use DocsLibrary;
use DocsLibrary_admin;

use Plack::Builder;

builder {
    mount '/'      => DocsLibrary->to_app;
    mount '/admin' => DocsLibrary_admin->to_app;
}
=cut