Permalink
Browse files

add app.psgi and some basic code to show a main page and to give 404 …

…otherwise
  • Loading branch information...
szabgab committed Oct 20, 2014
1 parent d8b2b3b commit 94db29297470e00357f347bcd0deb54717393454
Showing with 23 additions and 0 deletions.
  1. +1 −0 Makefile.PL
  2. +8 −0 app.psgi
  3. +14 −0 lib/MetaCPAN/SCO.pm
View
@@ -7,6 +7,7 @@ my %conf = (
AUTHOR => 'Gabor Szabo <szabgab@cpan.org>',
VERSION_FROM => 'lib/MetaCPAN/SCO.pm',
PREREQ_PM => {
'Plack::Request' => '0',
},
);
View
@@ -0,0 +1,8 @@
#!/usr/bin/perl
use strict;
use warnings;
use lib 'lib';
use MetaCPAN::SCO;
my $app = MetaCPAN::SCO->run;
View
@@ -2,6 +2,8 @@ package MetaCPAN::SCO;
use strict;
use warnings;
use Plack::Request;
our $VERSION = '0.01';
=head1 NAME
@@ -10,6 +12,18 @@ SCO - search.cpan.org clone
=cut
sub run {
my $app = sub {
my $env = shift;
my $request = Plack::Request->new($env);
if ($request->path_info eq '/') {
return [ '200', [ 'Content-Type' => 'text/plain' ], ['Hello'], ];
}
return [ '404', [ 'Content-Type' => 'text/html' ], ['404 Not Found'], ];
};
}
1;

0 comments on commit 94db292

Please sign in to comment.