Skip to content

Instantly share code, notes, and snippets.

@weverb2
Last active August 6, 2020 14:48
Show Gist options
  • Save weverb2/5b880737d3022b305a8692c1939be2ab to your computer and use it in GitHub Desktop.
Save weverb2/5b880737d3022b305a8692c1939be2ab to your computer and use it in GitHub Desktop.
object NetworkConfiguration {
const val BASE_URL = "https://jsonplaceholder.typicode.com/"
val retrofit = Retrofit.Builder()
.addConverterFactory(MoshiConverterFactory.create())
.client(OkHttpClient())
.baseUrl(BASE_URL)
.build()
fun getPlaceholderApi(): PlaceholderApi {
return retrofit.create(PlaceholderApi::class.java)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment