Skip to content

Instantly share code, notes, and snippets.

@carolinemusyoka
Created September 10, 2020 01:49
Show Gist options
  • Save carolinemusyoka/9f088a11a6667e255ef6054b0a5ac441 to your computer and use it in GitHub Desktop.
Save carolinemusyoka/9f088a11a6667e255ef6054b0a5ac441 to your computer and use it in GitHub Desktop.
object RetrofitBuilder {
private const val BASE_URL = "https://akabab.github.io/superhero-api/api/"
private fun getRetrofit(): Retrofit{
return Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build()
}
val apiService = getRetrofit().create(ApiService::class.java)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment