# Dependency Injection: How to switch API server?

**URL:** <https://discourse.elm-lang.org/t/dependency-injection-how-to-switch-api-server/570>\
**Category:** Learn\
**Created:** [January 24, 2018, 5:52am UTC](https://discourse.elm-lang.org/t/dependency-injection-how-to-switch-api-server/570 "2018-01-24T05:52:04Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![luke](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/luke/32/709_2.png) [@luke](https://discourse.elm-lang.org/u/luke)\
**Post date:** [January 29, 2018, 8:55am UTC](https://discourse.elm-lang.org/t/dependency-injection-how-to-switch-api-server/570/10 "2018-01-29T08:55:55Z")

</div>

In Ellie I write a variable with a string value that looks like `"%API_BASE%"` and then I use a string replacement plugin in my build to replace that string with whatever is in the process env

---

_[View the full topic](https://discourse.elm-lang.org/t/dependency-injection-how-to-switch-api-server/570)._
