summaryrefslogtreecommitdiffstats
path: root/src/Config.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Config.elm')
-rw-r--r--src/Config.elm12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Config.elm b/src/Config.elm
index 397bc38..95a15dd 100644
--- a/src/Config.elm
+++ b/src/Config.elm
@@ -1,22 +1,18 @@
module Config exposing (ApiResource(..), makeApiUrl)
+import Types exposing (Model)
import Utils exposing (templ)
-baseUrl : String
-baseUrl =
- "http://localhost:3000"
-
-
type ApiResource
= ApiPosts
| ApiLikePost String
| ApiCompose
-makeApiUrl : ApiResource -> String
-makeApiUrl res =
- String.replace "{baseUrl}" baseUrl <|
+makeApiUrl : Model -> ApiResource -> String
+makeApiUrl model res =
+ String.replace "{baseUrl}" model.apiURL <|
case res of
ApiPosts ->
"{baseUrl}/posts?_sort=createdAt&_order=desc"