Created
March 6, 2018 18:46
-
-
Save cdmunoz/e9a2bba419e2e27bd9748851e2c6f7db 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
class ApiClient { | |
companion object { | |
private const val BASE_URL = "https://api.coinmarketcap.com/v1/" | |
fun getClient(): Retrofit { | |
val okHttpClient = OkHttpClient.Builder().build() | |
val moshi = Moshi.Builder().build() | |
return Builder().client(okHttpClient).baseUrl(BASE_URL) | |
.addConverterFactory(MoshiConverterFactory.create(moshi)) | |
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | |
.build() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment