Skip to content

Instantly share code, notes, and snippets.

@furkanaskin
Created December 5, 2018 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furkanaskin/cd1011ac612e0816e71b3ce5ed883d98 to your computer and use it in GitHub Desktop.
Save furkanaskin/cd1011ac612e0816e71b3ce5ed883d98 to your computer and use it in GitHub Desktop.
object RetrofitFactory {
const val BASE_URL = "https://jsonplaceholder.typicode.com/"
fun makeRetrofitService(): RetrofitService {
return Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(CoroutineCallAdapterFactory())
.build().create(RetrofitService::class.java)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment