Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down