From 89fdad396f3c3c170dc3a688d74049e7f19c97a7 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 30 Dec 2013 08:46:07 +1300 Subject: [PATCH] Working on the dancer server for NCIP (for doing http (or https with nginx/apache in front) perl bin/ncip_dancing.pl And away you go --- bin/ncip_dancing.pl | 4 ++++ config.yml | 28 ++++++++++++++++++++++++++++ environments/development.yml | 27 +++++++++++++++++++++++++++ environments/production.yml | 17 +++++++++++++++++ lib/NCIP/Dancing.pm | 10 ++++++++++ 5 files changed, 86 insertions(+) create mode 100755 bin/ncip_dancing.pl create mode 100644 config.yml create mode 100644 environments/development.yml create mode 100644 environments/production.yml create mode 100644 lib/NCIP/Dancing.pm diff --git a/bin/ncip_dancing.pl b/bin/ncip_dancing.pl new file mode 100755 index 0000000..86950d2 --- /dev/null +++ b/bin/ncip_dancing.pl @@ -0,0 +1,4 @@ +#!/usr/bin/env perl +use Dancer; +use NCIP::Dancing; +dance; diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..e72abad --- /dev/null +++ b/config.yml @@ -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: "NCIP::Dancing" + +# 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: '%]' + diff --git a/environments/development.yml b/environments/development.yml new file mode 100644 index 0000000..1107437 --- /dev/null +++ b/environments/development.yml @@ -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 diff --git a/environments/production.yml b/environments/production.yml new file mode 100644 index 0000000..86801b4 --- /dev/null +++ b/environments/production.yml @@ -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 + diff --git a/lib/NCIP/Dancing.pm b/lib/NCIP/Dancing.pm new file mode 100644 index 0000000..0a6192a --- /dev/null +++ b/lib/NCIP/Dancing.pm @@ -0,0 +1,10 @@ +package NCIP::Dancing; +use Dancer ':syntax'; + +our $VERSION = '0.1'; + +get '/' => sub { + template 'index'; +}; + +true; -- 2.43.2