https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

Daan Panis

06/07/2021, 6:56 PM
Hi guys, I have ktor set up in my kmm project, and was wondering how I could make my API urls configurable, since I want to use a different api url for development compared to when I'm building the app for production. Any tips on how to achieve this?
m

MarkRS

06/08/2021, 10:33 AM
I use build flavours to do this, setting up resource files in the flavours with the different URLs in strings
x

xxfast

06/08/2021, 2:34 PM
You can configure your api url as a build config field. There’s a BuildConfig multiplatform implementation here https://github.com/yshrsmz/BuildKonfig