Bugzilla – Attachment 53995 Details for
Bug 17030
Configure the REST api on packages install
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17030: (followup) Rewrite rule for Plack
Bug-17030-followup-Rewrite-rule-for-Plack.patch (text/plain), 2.42 KB, created by
Tomás Cohen Arazi
on 2016-08-04 15:52:23 UTC
(
hide
)
Description:
Bug 17030: (followup) Rewrite rule for Plack
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2016-08-04 15:52:23 UTC
Size:
2.42 KB
patch
obsolete
>From 7955e65c9b154ce962d0423af18673d58d9d0b0a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 4 Aug 2016 12:47:13 -0300 >Subject: [PATCH] Bug 17030: (followup) Rewrite rule for Plack > >This patch fixes the TODO from the previous one. It implements the rewrite >on the Plack-related files so pretty uRLs can be used. > >To test: >- Follow the previous patches test steps (you should have a tweaked plack-psgi file > and Plack enabled) >- Grab > debian/templates/apache-shared-opac-plack.conf > debian/templates/apache-shared-intranet-plack.conf >and put them in /etc/koha >- Run: > $ sudo service apache2 restart >- Point your browser to: > http://localhost:8080/api/v1/app.pl/api/v1/patrons/50 >=> SUCCESS: You get the JSON output from the REST api >- Point your browser to the pretty URL: > http://localhost:8080/api/v1/patrons/50 >=> SUCCESS: You get the JSON output from the REST api >- Repeat for port 8081 (intranet) >- Sign off :-D >--- > debian/templates/apache-shared-intranet-plack.conf | 2 ++ > debian/templates/apache-shared-opac-plack.conf | 2 ++ > 2 files changed, 4 insertions(+) > >diff --git a/debian/templates/apache-shared-intranet-plack.conf b/debian/templates/apache-shared-intranet-plack.conf >index b544958..9da1240 100644 >--- a/debian/templates/apache-shared-intranet-plack.conf >+++ b/debian/templates/apache-shared-intranet-plack.conf >@@ -24,6 +24,8 @@ > # RequestHeader set X-FORWARDED-PROTO "https" > > #Â Point the intranet site to Plack >+ RewriteRule ^/api/(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L,PT] >+ > ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet" > ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet" > >diff --git a/debian/templates/apache-shared-opac-plack.conf b/debian/templates/apache-shared-opac-plack.conf >index 6a4b3b0..1850a0e 100644 >--- a/debian/templates/apache-shared-opac-plack.conf >+++ b/debian/templates/apache-shared-opac-plack.conf >@@ -18,6 +18,8 @@ > ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/opac" > > #Â Point the /api endpoint to Plack >+ 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" > >-- >2.9.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17030
:
53991
|
53992
|
53995
|
54008
|
54012
|
54013
|
54049
|
54050