Skip to content

Commit

Permalink
Added (empty) Dancer app.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jan 31, 2014
1 parent 1aa3b91 commit f750bc6
Show file tree
Hide file tree
Showing 17 changed files with 600 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ my $build = Module::Build->new(
DBIx::Class => 0,
DBD::mysql => 0,
Moose => 0,
YAML => 0,
Dancer => 1,
MooseX::MarkAsMethods => 0,
MooseX::NonMoose => 0,
DBIx::Class::EncodedColumn => 0,
Expand Down
4 changes: 4 additions & 0 deletions bin/app.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env perl
use Dancer;
use Lystyng;
dance;
28 changes: 28 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This is the main configuration file of your Dancer app
# env-related settings should go to environments/$env.yml
# all the settings in this file will be loaded at Dancer's startup.

# Your application's name
appname: "Lystyng"

# The default layout to use for your application (located in
# views/layouts/main.tt)
layout: "main"

# when the charset is set to UTF-8 Dancer will handle for you
# all the magic of encoding and decoding. You should not care
# about unicode within your app when this setting is set (recommended).
charset: "UTF-8"

# template engine
# simple: default and very basic template engine
# template_toolkit: TT

template: "simple"

# template: "template_toolkit"
# engines:
# template_toolkit:
# start_tag: '[%'
# end_tag: '%]'

27 changes: 27 additions & 0 deletions environments/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# configuration file for development environment

# the logger engine to use
# console: log messages to STDOUT (your console where you started the
# application server)
# file: log message to a file in log/
logger: "console"

# the log level for this environment
# core is the lowest, it shows Dancer's core log messages as well as yours
# (debug, info, warning and error)
log: "core"

# should Dancer consider warnings as critical errors?
warnings: 1

# should Dancer show a stacktrace when an error is caught?
show_errors: 1

# auto_reload is a development and experimental feature
# you should enable it by yourself if you want it
# Module::Refresh is needed
#
# Be aware it's unstable and may cause a memory leak.
# DO NOT EVER USE THIS FEATURE IN PRODUCTION
# OR TINY KITTENS SHALL DIE WITH LOTS OF SUFFERING
auto_reload: 0
17 changes: 17 additions & 0 deletions environments/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# configuration file for production environment

# only log warning and error messsages
log: "warning"

# log message to a file in logs/
logger: "file"

# don't consider warnings critical
warnings: 0

# hide errors
show_errors: 0

# cache route resolution for maximum performance
route_cache: 1

8 changes: 7 additions & 1 deletion lib/Lystyng.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Lystyng - Code for listing things

package Lystyng;

use Dancer ':syntax';
our $VERSION = '0.0.1';

1;
get '/' => sub {
template 'index';
};

true;

18 changes: 18 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Error 404</title>
<link rel="stylesheet" href="/css/error.css" />
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<h1>Error 404</h1>
<div id="content">
<h2>Page Not Found</h2><p>Sorry, this is the void.</p>
</div>
<div id="footer">
Powered by <a href="http://perldancer.org/">Dancer</a>.
</div>
</body>
</html>
18 changes: 18 additions & 0 deletions public/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Error 500</title>
<link rel="stylesheet" href="/css/error.css" />
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<h1>Error 500</h1>
<div id="content">
<h2>Internal Server Error</h2><p>Wooops, something went wrong</p>
</div>
<div id="footer">
Powered by <a href="http://perldancer.org/">Dancer</a>.
</div>
</body>
</html>
70 changes: 70 additions & 0 deletions public/css/error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
body {
font-family: Lucida,sans-serif;
}

h1 {
color: #AA0000;
border-bottom: 1px solid #444;
}

h2 { color: #444; }

pre {
font-family: "lucida console","monaco","andale mono","bitstream vera sans mono","consolas",monospace;
font-size: 12px;
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;
}

/* these are for the message boxes */

pre.content {
background-color: #eee;
color: #000;
padding: 1em;
margin: 0;
border: 1px solid #aaa;
border-top: 0;
margin-bottom: 1em;
}

div.title {
font-family: "lucida console","monaco","andale mono","bitstream vera sans mono","consolas",monospace;
font-size: 12px;
background-color: #aaa;
color: #444;
font-weight: bold;
padding: 3px;
padding-left: 10px;
}

pre.content span.nu {
color: #889;
margin-right: 10px;
}

pre.error {
background: #334;
color: #ccd;
padding: 1em;
border-top: 1px solid #000;
border-left: 1px solid #000;
border-right: 1px solid #eee;
border-bottom: 1px solid #eee;
}

Loading

0 comments on commit f750bc6

Please sign in to comment.