From 4d20d3ce35d050ffc4335714831c0f996e9f9c18 Mon Sep 17 00:00:00 2001 From: Taylor Franklin Date: Mon, 17 Apr 2017 16:20:22 -0500 Subject: [PATCH] fixed issue with app always using localhost and not finding bluemix uri --- Sources/TodoList/TodoItemExtension.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Sources/TodoList/TodoItemExtension.swift b/Sources/TodoList/TodoItemExtension.swift index 6598fc3..faf92aa 100644 --- a/Sources/TodoList/TodoItemExtension.swift +++ b/Sources/TodoList/TodoItemExtension.swift @@ -31,16 +31,14 @@ extension TodoItem : DictionaryConvertible { let url: String let manager = ConfigurationManager() - manager.load(.environmentVariables) - - if let configUrl = manager["url"] { - url = configUrl as! String + + if let configUrl = manager["VCAP_APPLICATION:uris:0"] as? String { + url = "https://" + configUrl } else { - url = localServerURL + url = manager["url"] as? String ?? localServerURL } - return url + "/api/todos/" + documentID }