Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing base URI to Api Documentation #44

Open
tpluscode opened this issue Jul 25, 2019 · 1 comment
Open

Providing base URI to Api Documentation #44

tpluscode opened this issue Jul 25, 2019 · 1 comment

Comments

@tpluscode
Copy link
Contributor

tpluscode commented Jul 25, 2019

The Api Documentation has to explicitly list endpoints for Express to hook up the router

A minimal document (excerpt) is like:

@base <http://localhost:9999/> .
@prefix hydra: <http://www.w3.org/ns/hydra/core#> .

api:Entrypoint a hydra:Class .

<> a api:Entrypoint .

The @base weird here as deploying to different environments will change the base URL. I propose that it is passed to the parser as a middleware parameter and skipped in the api doc graph:

return hydraBox.fromUrl('/api', 'file://' + path.join(__dirname, 'hydra/api.ttl'), {
  base: 'http://localhost:9999/',
})
@tpluscode
Copy link
Contributor Author

While I notice that the @base does not affect the middleware itself, it's still weird to have those resources appear in wrong namespace in the ApiDocumenation resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant