Skip to content

Commit

Permalink
Move the api to the root URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jan 19, 2016
1 parent 7e5c165 commit 78e44b0
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions bin/api.psgi
Expand Up @@ -40,16 +40,9 @@ my $app = WebAPI::DBIC::WebApp->new({
routes => [ map( $schema->source($_), $schema->sources) ]
})->to_psgi_app;

my $app_prefix = "/api";

builder {
enable "SimpleLogger"; # show on STDERR

mount "$app_prefix/" => builder {
mount "/browser" => $hal_app;
mount "/" => $app;
};

# root redirect for discovery - redirect to API
mount "/" => sub { [ 302, [ Location => "$app_prefix/" ], [ ] ] };
mount "/browser" => $hal_app;
mount "/" => $app;
};

0 comments on commit 78e44b0

Please sign in to comment.