Skip to content

Instantly share code, notes, and snippets.

@catalinghita8
Created September 6, 2020 14:52
Show Gist options
  • Select an option

  • Save catalinghita8/f9ba5e9daec031a7669c5b3214aa2a91 to your computer and use it in GitHub Desktop.

Select an option

Save catalinghita8/f9ba5e9daec031a7669c5b3214aa2a91 to your computer and use it in GitHub Desktop.
@InstallIn(ApplicationComponent::class)
@Module
class NetworkingModule {
@Provides
@Singleton
fun provideAuthInterceptorOkHttpClient(): OkHttpClient {
return OkHttpClient.Builder()
.build()
}
@Provides
@Singleton
fun provideRetrofit(
okHttpClient: OkHttpClient
): Retrofit {
return Retrofit.Builder()
.client(okHttpClient)
.baseUrl("https://codingtroops.com")
.build()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment