Skip to content

Instantly share code, notes, and snippets.

@typester
Created April 13, 2009 02:52
Show Gist options
  • Save typester/94232 to your computer and use it in GitHub Desktop.
Save typester/94232 to your computer and use it in GitHub Desktop.
404 Not Found!
package App;
use Ark;
1;
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin::libs;
use App;
use HTTP::Engine;
my $app = App->new;
$app->setup;
HTTP::Engine->new(
interface => {
module => 'ServerSimple',
args => {
host => '0.0.0.0',
port => 4423,
},
request_handler => $app->handler,
},
)->run;
package App::View::MT;
use Ark 'View::MT';
1;
package App::Controller::Root;
use Ark 'Controller';
has '+namespace' => default => '';
sub default :Path Args {
my ($self, $c) = @_;
$c->res->status(404);
$c->view('MT')->template('errors/404');
}
sub index :Path :Args(0) {
my ($self, $c) = @_;
}
sub end :Private {
my ($self, $c) = @_;
$c->res->header( 'Cache-Control' => 'private');
unless ($c->res->body or $c->res->status =~/^3\d\d/) {
$c->forward( $c->view('MT') );
}
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment