Register the config and the provider in configure.swift
let yelpConfig = YelpConfig(apiKey: "YOUR_API_KEY")
services.register(yelpConfig)
try services.register(YelpProvider())
And this is it. Now let’s see an example:
static func listCategories(_ req: Request) throws -> Future<Response> {
return try req.make(YelpClient.self).categories.getCategories().flatMap { res in
let categories = res.categories
// ...
// Do whatever you need to
// ...
return try res.encode(for: req)
}
}
All the documentation is available on the Yelp API website.
Yelp Provider is available under the MIT license. See the LICENSE file for more info.
YelpProvider
Yelp is a local-search service that helps people find local businesses like dentists, hair stylists and mechanics.
How To Use
In your
Package.swiftfile, add the followingRegister the config and the provider in
configure.swiftAnd this is it. Now let’s see an example:
All the documentation is available on the Yelp API website.
Yelp Provider is available under the MIT license. See the LICENSE file for more info.