Created
April 10, 2021 12:51
-
-
Save ajailani4/f861634f73009a6b9115ae4d3c8f8f04 to your computer and use it in GitHub Desktop.
This file contains 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
@Module | |
@InstallIn(SingletonComponent::class) | |
class ApplicationModule { | |
@Provides | |
fun provideBaseUrl() = "https://api-mobilespecs.azharimm.tk/" | |
@Provides | |
@Singleton | |
fun provideRetrofit(BASE_URL: String): Retrofit = | |
Retrofit.Builder() | |
.addConverterFactory(MoshiConverterFactory.create()) | |
.baseUrl(BASE_URL) | |
.build() | |
@Provides | |
@Singleton | |
fun provideApiService(retrofit: Retrofit): ApiService = | |
retrofit.create(ApiService::class.java) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment