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

Can't create a client with an URL with path as base #38

Closed
ferranmesas opened this issue Aug 7, 2017 · 4 comments · Fixed by #39
Closed

Can't create a client with an URL with path as base #38

ferranmesas opened this issue Aug 7, 2017 · 4 comments · Fixed by #39
Assignees

Comments

@ferranmesas
Copy link

Hello! At the company I work at we access all external services through a gateway. We're encountering a bit of an issue when accessing contentful using this method.
For example, we have the contentful management endpoint at gateway.example.com/contentful-management.

How can we configure the contentful js SDK so it accesses the right endpoints? We've used the host field in the past with success, even though the name indicates it's to be used with a host only. There's no parameter in the createClient() call allowing this kind of usage.

We'd be happy to contribute a new pair of parameters URL and UploadURL if needed!

@axe312ger axe312ger self-assigned this Aug 8, 2017
@axe312ger
Copy link
Contributor

Thank you for your feature request. There are two ways:

  • We provide an option like basePath which can be used to extend the url. So we avoid a breaking change and can release it to v3 of CDA and CMA
  • Support path's in the host parameter. That might be breaking and the naming is not really correct

I'll go for the first option and try to release a small release asap :)

@ferranmesas
Copy link
Author

Wow that was so quick! We don't need it right now, but will this change also support upload paths? the Upload endpoint also sits behind the gateway, but in a different path.

@axe312ger
Copy link
Contributor

yes it will only extend the url, should be fine :)

@axe312ger
Copy link
Contributor

@ferranmesas if you update contentful-sdk-core in your project, the new basePath option should already work. I'll release a new version of the CMA and CDA soon to enforce that new sdk-core version.

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

Successfully merging a pull request may close this issue.

2 participants