about summary refs log tree commit diff
path: root/lib/jitterbug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jitterbug.pm')
-rw-r--r--lib/jitterbug.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/jitterbug.pm b/lib/jitterbug.pm
new file mode 100644
index 0000000..47c186e
--- /dev/null
+++ b/lib/jitterbug.pm
@@ -0,0 +1,24 @@
+package jitterbug;
+
+BEGIN {
+    use Dancer ':syntax';
+    load_plugin 'jitterbug::Plugin::Redis';
+};
+
+our $VERSION = '0.1';
+
+load_app 'jitterbug::Hook',       prefix => '/hook';
+load_app 'jitterbug::Project',    prefix => '/project';
+load_app 'jitterbug::WebService', prefix => '/api';
+
+before_template sub {
+    my $tokens = shift;
+    $tokens->{uri_base} = request->base;
+};
+
+get '/' => sub {
+    my @projects = redis->smembers(key_projects);
+    template 'index', {projects => \@projects};
+};
+
+true;