openphacts / OPS_LinkedDataApi

A repository to host API configuration files, and code extensions
Other
9 stars 7 forks source link

Allow explicit setting of swagger basePath via env variable (BASE_PATH) #18

Closed jmartasek closed 8 years ago

jmartasek commented 8 years ago

To utilise authentication reverse proxy the swagger basePath needs to be configurable. The diff below actually allows for it:

diff --git a/index.php b/index.php index 0d7594d..3dc6fa3 100644 --- a/index.php +++ b/index.php @@ -35,8 +35,14 @@ if ("/swagger" == $Request->getPathWithoutVersionAndExtension()) { $swagger = file_get_contents("api-config-files/swagger.json", true); $json = json_decode($swagger, true); $base = pregreplace(",(.)/[^/]_$,", '$1/', $Request->getUri());

jmartasek commented 8 years ago

Actually having set BASE_PATH this value should propagate to the results too. E.g. result._about.

stain commented 8 years ago

Thanks for your contribution, @jmartasek.

Fix now live in ops-linkeddataapi Docker image, to update, try:

docker pull openphacts/ops-linkeddataapi

I added documentation to the ops-linkeddataapi README - I will also add it to the docker-compose.yml comments in ops-platform-setup.

jmartasek commented 8 years ago

Thanks Stien.

There is still the issue pending of having the BASE_PATH value propagate to the results too. E.g. result._about. Not sure if a new issue shall be raised...