[go: up one dir, main page]

Menu

[r1]: / G2G / G2G.pm  Maximize  Restore  History

Download this file

29 lines (22 with data), 616 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;