Skip to content

Commit

Permalink
produce an error if the static file is not araound
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Jun 22, 2011
1 parent 7184ebb commit ddc3188
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions software/backend/lib/EP/MojoApp.pm
Expand Up @@ -112,7 +112,12 @@ sub startup {
my $self = shift;
my $file = $self->param('path') || '';
$self->req->url->path('/'.$file); # relative paths get appended ...
return $apiDoc->dispatch($self);
if (not $apiDoc->dispatch($self)){
$self->render(
status => 404,
text => $self->req->url->path.' not found'
);
}
});
}

Expand All @@ -133,7 +138,7 @@ sub startup {
visualizer => $visualizer,
);

$self->plugin('EP::DocPlugin',{
$self->plugin('EP::DocPlugin', {
root => '/doc',
index => 'EP::Index',
template => Mojo::Asset::File->new(
Expand All @@ -147,7 +152,6 @@ sub startup {
ep => $service
}
});

}

1;
Expand Down

0 comments on commit ddc3188

Please sign in to comment.