Make endpoints under /api apart form in testing

This commit is contained in:
Tom Bloor 2017-04-05 00:44:49 +01:00
parent affa51d1e6
commit 85444b1c70

View file

@ -24,6 +24,7 @@ $self->plugin( 'Config', {
});
my $config = $self->config;
my $schema = Pear::LocalLoop::Schema->connect($config->{dsn},$config->{user},$config->{pass}) or die "Could not connect";
my $dbh = $schema->storage->dbh;
$dbh->do("PRAGMA foreign_keys = ON");
@ -38,6 +39,7 @@ $self->helper( db => sub { $dbh });
$self->helper( schema => sub { $schema });
my $r = $self->routes;
$r = $r->any('/api') if $self->app->mode ne 'testing';
$r->post("/register")->to('register#post_register');