From 85444b1c70584528dd39a0c3a3d667ba69e769a3 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Wed, 5 Apr 2017 00:44:49 +0100 Subject: [PATCH] Make endpoints under /api apart form in testing --- lib/Pear/LocalLoop.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Pear/LocalLoop.pm b/lib/Pear/LocalLoop.pm index 78d36fa..13ac99d 100644 --- a/lib/Pear/LocalLoop.pm +++ b/lib/Pear/LocalLoop.pm @@ -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');