question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue Description

Is there a way of changing the API URLs? I would like to use this library against an Enterprise GitHub and so I need to change the default URL.

I found that it is implicitly passed to individual constructors of the APIs in Interpreters.scala, but I have no idea if it can be changed to something else.

Just as a side note, I really like the design of the library in principle, but it is very hard to use for people that don’t have experience with Cats. You should consider either improving the docs (I couldn’t even get the current Getting Started to compile) or providing a higher level API on top, that does not leak the Monad abstractions and underlying libraries.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
svshbcommented, Nov 22, 2017

There are somewhat ugly but working hack to change urls:

val clazz = GithubDefaultUrls.getClass
val field = clazz.getDeclaredField("defaultUrls")
val accessibility = field.isAccessible
field.setAccessible(true)
field.set(
  GithubDefaultUrls,
  GithubApiUrls(
    "https://api.github.com/",
    "https://github.com/login/oauth/authorize?client_id=%s&redirect_uri=%s&scope=%s&state=%s",
    "https://github.com/login/oauth/access_token"
  )
)
field.setAccessible(accessibility)

It still would be nice to have a proper way to set url’s 😃

0reactions
bilkicommented, Jul 11, 2019

I think there is no easy way to change this without breaking current users programs, as there is an explicit import of GithubDefaultUrls in the Interpreters file.

Removing this import breaks the compilation, and adding a new implicit that fixes that in the Interpreters class argument list forces a change upwards into Implicits files to allow the user to inject its own GithubApiUrls (or import github4s.GithubDefaultUrls._)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modify the URL Path Function for Your ShortPoint REST API ...
This article sets out to explain how you can use the Modify URL path function to dynamically edit, add or remove directories in...
Read more >
Can I change the API url of a third Party API? - Stack Overflow
I want to request a third party API on Web APP. The API example is https://api.pinesapsapi.com/request. Can I change the URL and build...
Read more >
Change the URL of ArcGIS API for JavaScript
To change the URL of ArcGIS API for JavaScript, complete the following steps: Open the env.js file. Search for the phrase //apiUrl='//js.arcgis.com/3.14';.
Read more >
Change the Web API URL - - PowerServer 2022 Help
To change the Web API URL for a deployed application: Install the ASP.NET Core Runtime 3.1 or later. Open the command prompt. (You'd...
Read more >
How do I change the REST API URL using Command Line ...
3. Use the TrebuchetCommandLineConfigure.exe program command along with the /restapiurl sub-command to set the new API URL. (and press Enter ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found