#!/usr/bin/perl

use strict;
use warnings;
$| = 1;

use URI;

use lib qw(./libs);
use API::Config;
use API::Utils::Daemon ();
use API::Applicator ();

use lib ($API::Config::Config->{'Website_libs'});
use ECS::Config;
use ECS::DB;

my $configURI = URI->new($ECS::Config::c{'applicatorDaemonURL'});

my $daemon = API::Utils::Daemon->new(
    'LocalPort' => $configURI->port(),
    'ReuseAddr' => 1,
    )
    ->max_threads(4)
    ->dispatch_to('API::Applicator')
    ->handle();

ECS::DB->dbDisconnectAllHandles();

exit;
