package Templar; use DBI; use Dancer2; #use Dancer2::Plugin::Ajax; use Dancer2::Plugin::Database; use Template; use HTML::Escape qw/escape_html/; use Crypt::SaltedHash; use Data::Dumper; our $VERSION = '0.1'; hook before => sub { if (!session('logged_in') && request->dispatch_path !~ m{^/login}) { return forward '/login', { requested_path => request->dispatch_path }; } }; #ajax '/p_details' => sub { "ajax test" }; get '/p_details' => sub { "ajax test" };