diff options
| author | Emil Williams | 2025-08-21 09:38:10 +0000 |
|---|---|---|
| committer | Emil Williams | 2025-08-21 09:38:10 +0000 |
| commit | 468fd592c2124e91d4129ff21238fe7c2e44134e (patch) | |
| tree | cac74f0becee6c002be96bbc88dea0577093c47b /perl/cgi.pl | |
| parent | 0230b7bd2e4dddac99218d69076ac8da550a57a3 (diff) | |
| download | gorillanest-468fd592c2124e91d4129ff21238fe7c2e44134e.tar.xz gorillanest-468fd592c2124e91d4129ff21238fe7c2e44134e.tar.zst | |
Isolate Things Pt. 2, FCGI
Diffstat (limited to 'perl/cgi.pl')
| -rwxr-xr-x | perl/cgi.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/perl/cgi.pl b/perl/cgi.pl index c5cd950..fc8e466 100755 --- a/perl/cgi.pl +++ b/perl/cgi.pl @@ -112,21 +112,23 @@ sub GN::cgi { serve_template("404.tt", {}); # XXX missing code } -sub GN::main() { - my $root = GIT_ROOT; +sub GN::init() { my %data = ( found => 0, ); - my %routes = ( '/' => sub { GN::index($root); }, '/~([\w.]+)' => sub { GN::user($root, @_) }, '/~([\w.]+)/([\w.]+)' => sub { GN::repository($root, @_) }, ); - my %routes_cache = map { $_ => qr{^$_$} } keys %routes; + return \%data, \%routes, \%routes_cache; +} - GN::cgi(\%data, \%routes, \%routes_cache); +sub GN::main() { + my $root = GIT_ROOT; + my ($data, $routes, $routes_cache) = GN::init(); + GN::cgi($data, $routes, $routes_cache); } GN::main() if !caller; |
