Change base url to production server

This commit is contained in:
Selim Mustafaev 2020-06-01 11:44:37 +03:00
parent 523fb5d411
commit db9d165a3b
2 changed files with 4 additions and 3 deletions

View File

@ -2,14 +2,12 @@ import Foundation
import RxSwift
class Api {
private static let baseUrl = "http://127.0.0.1:3000/" //"https://vps.aliencat.pro:8443/"
private static func genError(_ msg: String, suggestion: String, code: Int = 0) -> Error {
return NSError(domain: "", code: code, userInfo: [NSLocalizedDescriptionKey: msg, NSLocalizedRecoverySuggestionErrorKey: suggestion])
}
private static func createRequest<T>(api: String, method: String, body: [String: T]? = nil) -> URLRequest? where T: LosslessStringConvertible {
guard var urlComponents = URLComponents(string: baseUrl + api) else { return nil }
guard var urlComponents = URLComponents(string: Constants.baseUrl + api) else { return nil }
if let body = body, method.uppercased() == "GET" {
urlComponents.queryItems = body.map { URLQueryItem(name: $0, value: String($1)) }

View File

@ -1,6 +1,9 @@
import Foundation
enum Constants {
static let baseUrl = "https://vps.aliencat.pro:8443/"
static let debugBaseUrl = "http://127.0.0.1:3000/"
static let googleAuthURL = "https://accounts.google.com/o/oauth2/v2/auth"
static let googleTokenURL = "https://oauth2.googleapis.com/token"
static let googleRedirectURL = "com.googleusercontent.apps.994679674451-k7clunkk4nicl6iuajdtc5u7hvustbdb:/oauth2callback"