Slide 16
Slide 16 text
L I V E B A C K E N D I N I T I A L I Z E R
class LiveBackEndAPI: BackEndAPIType {
let client: MyBackEndAPIClient
init(apiKey: String? = nil, baseURL: URL? = nil, client:
MyBackEndAPIClient = MyBackEndAPIClient.default()) {
self.client = client
if let apiKey = apiKey {
self.client.apiKey = apiKey
}
if let baseURL = baseURL {
let endpoint = AWSEndpoint(region:
client.configuration.regionType, service: .APIGateway, url: baseURL)
self.client.configuration.baseURL = baseURL
self.client.configuration.endpoint = endpoint
}
}