Skip to content

Commit

Permalink
fixed rc.5 breaks in hummingbird example (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliemeobn authored Aug 28, 2024
1 parent 22be44d commit d73d3b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Examples/HummingbirdDemo/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ let package = Package(
.executable(name: "App", targets: ["App"]),
],
dependencies: [
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-rc.1"),
.package(url: "https://github.com/hummingbird-community/hummingbird-elementary.git", from: "0.1.0-rc.1"),
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-rc.5"),
.package(url: "https://github.com/hummingbird-community/hummingbird-elementary.git", from: "0.2.0-rc.1"),
.package(path: "../../"),
.package(url: "https://github.com/apple/swift-async-algorithms", from: "1.0.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.0.0"),
Expand Down
5 changes: 2 additions & 3 deletions Examples/HummingbirdDemo/Sources/App/Routes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ func addRoutes(to router: Router<some RequestContext>) {
}
}

router.get("/time") { _, context in
router.get("/time") { _, _ in
Response(
status: .ok,
headers: [.contentType: "text/event-stream"],
body: .init { writer in
while true {
try await writer.write(context.allocator.buffer(
string: "data: \(TimeHeading().render())\n\n"))
try await writer.write(ByteBuffer(string: "data: \(TimeHeading().render())\n\n"))
try await Task.sleep(for: .seconds(1))
}
}
Expand Down

0 comments on commit d73d3b3

Please sign in to comment.