From e23307ce6ef1b2d69b13887b73ef58595df88626 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Wed, 24 Aug 2016 11:43:08 +0200 Subject: [PATCH] Revert "Bug 17030: Make REST api available on packages with plack enabled" This reverts commit 222496f04550dd4819456d8302ef211897e2d8a7. --- .../templates/apache-shared-intranet-plack.conf | 7 ++----- debian/templates/apache-shared-opac-plack.conf | 7 ++----- debian/templates/plack.psgi | 16 ++++++---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/debian/templates/apache-shared-intranet-plack.conf b/debian/templates/apache-shared-intranet-plack.conf index f77f6403e0..91e47f681d 100644 --- a/debian/templates/apache-shared-intranet-plack.conf +++ b/debian/templates/apache-shared-intranet-plack.conf @@ -28,11 +28,8 @@ ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet" # Point the /api endpoint to Plack - RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl - RewriteRule ^/api/(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L,PT] - - ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" - ProxyPassReverse /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" + # ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" + # ProxyPassReverse /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" diff --git a/debian/templates/apache-shared-opac-plack.conf b/debian/templates/apache-shared-opac-plack.conf index f68e3d28f1..95787d81b7 100644 --- a/debian/templates/apache-shared-opac-plack.conf +++ b/debian/templates/apache-shared-opac-plack.conf @@ -18,11 +18,8 @@ ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac" # Point the /api endpoint to Plack - RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl - RewriteRule ^/api/(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L,PT] - - ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" - ProxyPassReverse /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" + # ProxyPass /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" + # ProxyPassReverse /api "unix:/var/run/koha/${instance}/plack.sock|http://localhost/api" diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi index 397998f200..704b91b5a4 100644 --- a/debian/templates/plack.psgi +++ b/debian/templates/plack.psgi @@ -25,8 +25,6 @@ use Plack::App::CGIBin; use Plack::App::Directory; use Plack::App::URLMap; -use Mojo::Server::PSGI; - # Pre-load libraries use C4::Boolean; use C4::Branch; @@ -62,18 +60,16 @@ my $opac = Plack::App::CGIBin->new( root => '/usr/share/koha/opac/cgi-bin/opac' )->to_app; -my $apiv1 = builder { - my $server = Mojo::Server::PSGI->new; - $server->load_app('/usr/share/koha/api/v1/app.pl'); - $server->to_psgi_app; -}; +# my $api = Plack::App::CGIBin->new( +# root => '/usr/share/koha/api/' +# )->to_app; builder { enable "ReverseProxy"; enable "Plack::Middleware::Static"; - mount '/opac' => $opac; - mount '/intranet' => $intranet; - mount '/api/v1/app.pl' => $apiv1; + mount '/opac' => $opac; + mount '/intranet' => $intranet; + # mount '/api' => $api; }; -- 2.39.5