Skip to content

Commit 81deeb9

Browse files
authored
Changes for 2.0.0-alpha.1 release (#13)
* Use HB 2.0.0-alpha.1 * Update README
1 parent 61be1c2 commit 81deeb9

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let package = Package(
1313
],
1414
dependencies: [
1515
.package(url: "https://github.com/apple/swift-openapi-runtime.git", from: "1.0.0"),
16-
.package(url: "https://github.com/hummingbird-project/hummingbird.git", branch: "2.x.x"),
16+
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-alpha.1"),
1717
],
1818
targets: [
1919
.target(

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33
Hummingbird transport for [OpenAPI generator](https://github.com/apple/swift-openapi-generator).
44

55
```swift
6-
// Create your Hummingbird application.
7-
let app = HBApplication()
8-
9-
// Create a Hummingbird OpenAPI Transport using your application.
10-
let transport = HBOpenAPITransport(app)
6+
// Create your router.
7+
let router = HBRouter()
118

129
// Create an instance of your handler type that conforms the generated protocol
1310
// defining your service API.
14-
let handler = MyServiceAPIImpl()
11+
let api = MyServiceAPIImpl()
1512

1613
// Call the generated function on your implementation to add its request
1714
// handlers to the app.
18-
try handler.registerHandlers(on: transport, serverURL: Servers.server1())
15+
try api.registerHandlers(on: router)
1916

20-
// Start the app as you would normally.
21-
try app.start()
22-
app.wait()
17+
// Create the application and run as you would normally.
18+
let app = HBApplication(router: router)
19+
try await app.runService()
2320
```
2421

2522
## Documentation

0 commit comments

Comments
 (0)