Created
April 13, 2009 02:52
-
-
Save typester/94232 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 404 Not Found! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package App; | |
| use Ark; | |
| 1; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| index! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package App::View::MT; | |
| use Ark 'View::MT'; | |
| 1; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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