This class is responsible for the main task. It will be responsive for the control of all the tasks using the Retrofit.builder class and will configure it with the base of the given URL.
Here is the code of UserServiceImpl.kt:
class GithubServiceImpl{
fun getGithubServiceFactory(): GithubService {
val retrofit = Retrofit.Builder()
.baseUrl("https://api.github.com/")
.addConverterFactory(GsonConverterFactory.create())
.build()
return retrofit.create(GithubService::class.java)
}
}
Here, our baseUrl() is https://api.github.com/.