Skip to content

Commit

Permalink
Merge pull request #32 from IBM-Swift/url-fix
Browse files Browse the repository at this point in the history
Fixed app not finding bluemix uri
  • Loading branch information
Jennifer Oliver authored Apr 18, 2017
2 parents 4d3e827 + 4d20d3c commit 738148d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Sources/TodoList/TodoItemExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 738148d

Please sign in to comment.