package Apache::G2G;
use strict;
use Apache::Constants qw(:common);
use Bio::Genex::G2G;
sub handler {
my $r = shift;
return DECLINED
unless $r->method() eq 'POST';
my $content;
$r->read($content, $r->header_in('Content-Length'));
return DECLINED
unless $content;
# The database to use is specified as extra path information on the URL
my $data_source = $r->path_info();
# remove the leading and trailing '/'
$data_source =~ s|^/||;
$data_source =~ s|/$||;
# we let Bio::Genex::G2G do all the work
my $rc = Bio::Genex::G2G->request($r,$data_source,$content);
return $rc;
}
1;