Skip to content

Commit

Permalink
Changes for 2.0.0-alpha.1 release (#13)
Browse files Browse the repository at this point in the history
* Use HB 2.0.0-alpha.1

* Update README
  • Loading branch information
adam-fowler committed Jan 23, 2024
1 parent 61be1c2 commit 81deeb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
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

0 comments on commit 81deeb9

Please sign in to comment.