Skip to content

Commit

Permalink
Provide a redirect when requesting / rather than erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
jberger committed Nov 18, 2016
1 parent 9339e16 commit d986d00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/MetaCPAN/Server/Controller/Root.pm
Expand Up @@ -15,6 +15,15 @@ sub default : Path {
$c->forward( '/not_found', [] );
}

# handle /
sub all : Path('') : Args(0) {
my ( $self, $c ) = @_;
$c->res->redirect(
'https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md',
301
);
}

# The parent class has a sub with this signature but expects a namespace
# and an es type... since this controller doesn't have those, just overwrite.
sub get : Path('') : Args(1) {
Expand Down

0 comments on commit d986d00

Please sign in to comment.