Created
May 22, 2019 11:16
-
-
Save saddahussain/d7664d4d2209e280865f4d271023e2c6 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
object RetrofitClient { | |
private const val BASE_URL = "" | |
private lateinit var retrofit: Retrofit | |
fun getClient(): APIService { | |
if (retrofit == null) { | |
retrofit = Retrofit.Builder() | |
.baseUrl(BASE_URL) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build() | |
} | |
return retrofit.create(APIService::class.java) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment