You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.6 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. //
  2. // UrlManager.swift
  3. // GMERemittance
  4. //
  5. // Created by Sujal on 12/25/17.
  6. // Copyright © 2017 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class UrlManager {
  10. static let sharedInstance = UrlManager()
  11. var version = "v1"
  12. var baseURL = ""
  13. let baseSocialURL = ""
  14. let oldUatServer = "http://gmeuat.gmeremit.com:5012/api/v1/"
  15. let staggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/"
  16. let liveServerUrl = "https://mobileapi.gmeremit.com:8002/api/"
  17. let uatServer = "http://gmeuat.gmeremit.com:5012/api/"
  18. let justinServer = "https://\((GMEDB.shared.app.string(.ngrokHost) ?? "")).ngrok.io/api/"
  19. init() {
  20. switch server {
  21. case .uat:
  22. self.baseURL = uatServer
  23. case .staging:
  24. self.baseURL = staggingServerUrl
  25. case .live:
  26. self.baseURL = liveServerUrl
  27. case .uat2:
  28. self.baseURL = "http://gmeuat.gmeremit.com:5018/api/"
  29. case .kftcTest:
  30. self.baseURL = "http://gmeuat.gmeremit.com:5008/api/"
  31. case .ngrok:
  32. self.baseURL = justinServer
  33. case .testLive:
  34. self.baseURL = "http://203.223.132.110:9093/api/"
  35. }
  36. }
  37. func refreshBaseURL() {
  38. switch server {
  39. case .uat:
  40. self.baseURL = uatServer
  41. case .staging:
  42. self.baseURL = staggingServerUrl
  43. case .live:
  44. self.baseURL = liveServerUrl
  45. case .uat2:
  46. self.baseURL = "http://gmeuat.gmeremit.com:5018/api/"
  47. case .kftcTest:
  48. self.baseURL = "http://gmeuat.gmeremit.com:5008/api/"
  49. case .ngrok:
  50. self.baseURL = justinServer
  51. case .testLive:
  52. self.baseURL = "http://203.223.132.110:9093/api/"
  53. }
  54. }
  55. }