Tomas Cohen Arazi
e4bb70a447
This patch is the starting point for making the REST api available on Plack. What it does: - It creates the /api/v1/app.pl mount point in plack.psgi - It enables the ProxyPass and ProxyPassReverse directives so it is reached through Plack. - It sets rewrite rules so we can use the 'pretty' urls (i.e. /api/v1/patrons instead of /api/v1/app.pl/api/v1/patrons). To test: - Grab the following files, and put them in /etc/koha (overwrite the existing ones) debian/templates/apache-shared-intranet-plack.conf debian/templates/apache-shared-opac-plack.conf - Tweak your /etc/koha/sites/kohadev/plack.psgi file so the API-related stuff is present on your file. - Make sure Plack is enabled for the instance: $ sudo koha-plack --enable kohadev $ sudo koha-plack --restart kohadev $ sudo service apache2 restart - Follow the previous patch test plan, but use this URLs (no pretty URL): http://localhost:8080/api/v1/app.pl/api/v1/patrons/50 http://localhost:8081/api/v1/app.pl/api/v1/patrons/50 => SUCCESS: You get a JSON response from the API [1] - Not use this URLs: http://localhost:8080/api/v1/patrons/50 http://localhost:8081/api/v1/patrons/50 => SUCCESS: You get a JSON response from the API [1] - Sign off :-D [1] this patch made a bug visible (the session is lost when accessing the API through Plack) but it shouldn't prevent its inclusion because the API right now is not even available as default for developers to test or fix it. Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> |
||
---|---|---|
.. | ||
apache-shared-disable.conf | ||
apache-shared-intranet-plack.conf | ||
apache-shared-intranet.conf | ||
apache-shared-opac-plack.conf | ||
apache-shared-opac.conf | ||
apache-shared.conf | ||
apache-site-https.conf.in | ||
apache-site.conf.in | ||
koha-common.conf | ||
koha-conf-site.xml.in | ||
koha-sites.conf | ||
log4perl-site.conf.in | ||
marc21-retrieval-info-auth-dom.xml | ||
marc21-retrieval-info-auth-grs1.xml | ||
marc21-retrieval-info-bib-dom.xml | ||
marc21-retrieval-info-bib-grs1.xml | ||
normarc-retrieval-info-auth-dom.xml | ||
normarc-retrieval-info-auth-grs1.xml | ||
normarc-retrieval-info-bib-dom.xml | ||
normarc-retrieval-info-bib-grs1.xml | ||
plack.psgi | ||
SIPconfig.xml | ||
unimarc-retrieval-info-auth-dom.xml | ||
unimarc-retrieval-info-auth-grs1.xml | ||
unimarc-retrieval-info-bib-dom.xml | ||
unimarc-retrieval-info-bib-grs1.xml | ||
zebra-authorities-dom-site.cfg.in | ||
zebra-authorities-site.cfg.in | ||
zebra-biblios-dom-site.cfg.in | ||
zebra-biblios-site.cfg.in | ||
zebra.passwd.in |