]> git.evergreen-ils.org Git - working/NCIPServer.git/blob - lib/NCIP/Dancing.pm
Get NCIP configuration directory from the environment.
[working/NCIPServer.git] / lib / NCIP / Dancing.pm
1 package NCIP::Dancing;
2 use Dancer ':syntax';
3
4 our $VERSION = '0.1';
5
6 use NCIP;
7
8 my $conf_dir = $ENV{'NCIP_CONFIG_DIR'} || 't/config_sample';
9
10 any [ 'get', 'post' ] => '/' => sub {
11     content_type 'application/xml';
12     my $ncip = NCIP->new($conf_dir);
13     my $xml  = param 'xml';
14     if ( request->is_post ) {
15         $xml = request->body;
16     }
17     my $content = $ncip->process_request($xml);
18 #    warn $content;
19     template 'main', { content => $content };
20 };
21
22 true;