Skip to content

Instantly share code, notes, and snippets.

@nderkach
Created December 7, 2017 11:39
Show Gist options
  • Select an option

  • Save nderkach/5ef87a3cda785173bdbc8fae38113cd0 to your computer and use it in GitHub Desktop.

Select an option

Save nderkach/5ef87a3cda785173bdbc8fae38113cd0 to your computer and use it in GitHub Desktop.
import Siesta
let baseURL = "https://jwt-api-siesta.herokuapp.com"
let AwesomeAPI = _AwesomeAPI()
class _AwesomeAPI {
// MARK: - Configuration
private let service = Service(
baseURL: baseURL,
standardTransformers: [.text, .image]
)
fileprivate init() {
// –––––– Global configuration ––––––
#if DEBUG
LogCategory.enabled = [.network]
#endif
}
// MARK: - Resource Accessors
func ping() -> Resource {
return service.resource("/ping")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment