#!/usr/bin/env perl
# configures Routes & Routes::AJAX as separate apps
# read pod at top of Routes::AJAX
# doesn't work with Apache as .psgi - can't find ajax route
use strict;
use warnings;
use FindBin;
use lib '/home/raj/perl-lib'; # MooX::Types
use lib $FindBin::Bin . '/../lib'; # warn $FindBin::Bin;
use Plack::Builder;
use Devel::Confess; # to get full stacktrace instead of "eval nnn line nnn"
use Reporter::Routes;
use Reporter::Routes::AJAX;
builder {
mount '/' => Reporter::Routes->to_app,
mount '/ajax' => Reporter::Routes::AJAX->to_app,
};
# Reporter::Routes->to_app; # don't use dance keyword for production:
=begin https://github.com/PerlDancer/Dancer2/issues/814#ref-commit-032a202
dance is a keyword that starts a web server on its own. You don't want to actually use
that in production, because it forces a single dispatcher across all loaded applications
in the process memory, as explained in the following advent calendar article:
http://advent.perldancer.org/2014/9
=cut