Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding error section

  • Loading branch information...
commit daba2fff4d1712c1c4779ebc071a7912adbfcf1f 1 parent f3309a1
Alexis Sukrieh authored
View
15 app.psgi
@@ -0,0 +1,15 @@
+# This is a PSGI application file for Apache+Plack support
+use lib '/home/sukria/Devel/perldancer-website';
+use perldancer-website;
+
+use Dancer::Config 'setting';
+setting apphandler => 'PSGI';
+setting environment => 'production';
+Dancer::Config->load;
+
+my $handler = sub {
+ my $env = shift;
+ local *ENV = $env;
+ my $cgi = CGI->new();
+ Dancer->dance($cgi);
+};
View
19 perldancer.pm
@@ -0,0 +1,19 @@
+package perldancer;
+use Dancer;
+#use Template;
+
+my @pages = qw(quickstart documentation contribute about example download);
+
+get '/' => sub {
+ my $toto;
+ $toto += "";
+ template 'home';
+};
+
+get '/:page' => sub {
+ my ($page) = params->{page};
+ pass and return false unless grep /$page/, @pages;
+ template $page;
+};
+
+true;
View
13 public/404.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
+<head>
+<title>Error 404</title>
+<link rel="stylesheet" type="text/css" href="/css/style.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+</head>
+<body>
+<h1>Error 404</h1><div id="content"><p><h2>Page Not Found</h2><p>Sorry, this is the void.</p></p></div><div id="footer">Powered by <a href="http://dancer.sukria.net">Dancer</a></div>
+</body>
+</html>
View
13 public/500.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
+<head>
+<title>Error 500</title>
+<link rel="stylesheet" type="text/css" href="/css/style.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+</head>
+<body>
+<h1>Error 500</h1><div id="content"><p><h2>Internal Server Error</h2><p>Wooops, something went wrong</p></p></div><div id="footer">Powered by <a href="http://dancer.sukria.net">Dancer</a></div>
+</body>
+</html>
View
32 public/css/error.css
@@ -0,0 +1,32 @@
+body {
+ font-family: Lucida,sans-serif;
+}
+
+h1 {
+ color: #AA0000;
+ border-bottom: 1px solid #444;
+}
+
+h2 { color: #444; }
+
+pre {
+ font-family: monospace;
+ font-size: 14px;
+ border-left: 2px solid #777;
+ padding-left: 1em;
+}
+
+#footer {
+ font-size: 10px;
+}
+
+span.key {
+ color: #449;
+ font-weight: bold;
+ width: 120px;
+ display: inline;
+}
+
+span.value {
+ color: #494;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.