diff --git a/Package.swift b/Package.swift index fbb1ccb..6c00c90 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/apple/swift-openapi-runtime.git", from: "1.0.0"), - .package(url: "https://github.com/hummingbird-project/hummingbird.git", branch: "2.x.x"), + .package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-alpha.1"), ], targets: [ .target( diff --git a/README.md b/README.md index be621e2..0088ce5 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,20 @@ Hummingbird transport for [OpenAPI generator](https://github.com/apple/swift-openapi-generator). ```swift -// Create your Hummingbird application. -let app = HBApplication() - -// Create a Hummingbird OpenAPI Transport using your application. -let transport = HBOpenAPITransport(app) +// Create your router. +let router = HBRouter() // Create an instance of your handler type that conforms the generated protocol // defining your service API. -let handler = MyServiceAPIImpl() +let api = MyServiceAPIImpl() // Call the generated function on your implementation to add its request // handlers to the app. -try handler.registerHandlers(on: transport, serverURL: Servers.server1()) +try api.registerHandlers(on: router) -// Start the app as you would normally. -try app.start() -app.wait() +// Create the application and run as you would normally. +let app = HBApplication(router: router) +try await app.runService() ``` ## Documentation