summaryrefslogtreecommitdiffstats
path: root/new.psgi
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-05 03:24:29 +0200
committerDylan William Hardison <dylan@hardison.net>2018-06-28 22:41:54 +0200
commite680057dd24ea4290096f4420bdd5c354acea024 (patch)
treee4aef0eb7755dc8b784901c83eee23f6c13b8638 /new.psgi
parented6d5cdaaeac6422e5933e4e8138b481e35ab4f3 (diff)
downloadbugzilla-e680057dd24ea4290096f4420bdd5c354acea024.tar.gz
bugzilla-e680057dd24ea4290096f4420bdd5c354acea024.tar.xz
support cgi->http(), remote_ip(), and fix sanity tests
Diffstat (limited to 'new.psgi')
-rwxr-xr-xnew.psgi17
1 files changed, 16 insertions, 1 deletions
diff --git a/new.psgi b/new.psgi
index 8f1484d91..7685a7392 100755
--- a/new.psgi
+++ b/new.psgi
@@ -1,4 +1,17 @@
#!/usr/bin/env perl
+use 5.10.1;
+use strict;
+use warnings;
+
+use File::Basename qw(basename dirname);
+use File::Spec::Functions qw(catdir rel2abs);
+
+BEGIN {
+ require lib;
+ my $dir = rel2abs( dirname(__FILE__) );
+ lib->import( $dir, catdir( $dir, 'lib' ), catdir( $dir, qw(local lib perl5) ) );
+}
+
use Mojolicious::Lite;
use Bugzilla::Constants;
use Bugzilla::CGI::Mojo;
@@ -6,7 +19,6 @@ use Try::Tiny;
plugin 'PODRenderer';
-
app->hook(
around_dispatch => sub {
my ($next, $c) = @_;
@@ -33,9 +45,12 @@ __DATA__
@@ index.html.ep
% layout 'default';
% title 'Welcome';
+% use Bugzilla::Util qw(remote_ip);
<p>Hello, <%= $user->name %> &lt;<%= $user->email %>&gt;
</p>
+<p>Your ip is <%= remote_ip() %>
+</p>
@@ layouts/default.html.ep
<!DOCTYPE html>