Created
September 6, 2020 14:52
-
-
Save catalinghita8/f9ba5e9daec031a7669c5b3214aa2a91 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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