#!/usr/bin/perl

# This use lib saves having to install the module repeatedly during testing.

use lib '/home/ron/perl.modules/CGI-Application-Demo-Ajax/lib';
use strict;
use warnings;

use CGI::Application::Dispatch;
use CGI::Fast;
use FCGI::ProcManager;

# ---------------------

my($proc_manager) = FCGI::ProcManager -> new({processes => 2});

$proc_manager -> pm_manage();

my($cgi);

while ($cgi = CGI::Fast -> new() )
{
	$proc_manager -> pm_pre_dispatch();
	CGI::Application::Dispatch -> dispatch
	(
	 args_to_new => {QUERY => $cgi},
	 prefix      => 'CGI::Application::Demo',
	 table       =>
	 [
	  ''        => {app => 'Ajax', rm => 'initialize'},
	  '/search' => {app => 'Ajax', rm => 'search'},
	 ],
	);
	$proc_manager -> pm_post_dispatch();
}
