Skip to content

Commit

Permalink
Merge pull request #1 from hummingbird-project/jo/update-template
Browse files Browse the repository at this point in the history
Update the HB 2 template
  • Loading branch information
adam-fowler authored Mar 22, 2024
2 parents 1d098d3 + 4379582 commit abc6ccc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
.executable(name: "App", targets: ["App"]),
],
dependencies: [
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-alpha.1"),
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-beta.1"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0")
],
targets: [
Expand All @@ -29,7 +29,7 @@ let package = Package(
.testTarget(name: "AppTests",
dependencies: [
.byName(name: "App"),
.product(name: "HummingbirdXCT", package: "hummingbird")
.product(name: "HummingbirdTesting", package: "hummingbird")
]
)
]
Expand Down
6 changes: 3 additions & 3 deletions Sources/App/Application+build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ public protocol AppArguments {
var port: Int { get }
}

public func buildApplication(_ arguments: some AppArguments) -> some HBApplicationProtocol {
let router = HBRouter()
public func buildApplication(_ arguments: some AppArguments) -> some ApplicationProtocol {
let router = Router()
router.get("/health") { _,_ -> HTTPResponse.Status in
return .ok
}
let app = HBApplication(
let app = Application(
router: router,
configuration: .init(
address: .hostname(arguments.hostname, port: arguments.port),
Expand Down
4 changes: 2 additions & 2 deletions Tests/AppTests/AppTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testable import App
import Hummingbird
import HummingbirdXCT
import HummingbirdTesting
import XCTest

final class AppTests: XCTestCase {
Expand All @@ -13,7 +13,7 @@ final class AppTests: XCTestCase {
let args = TestArguments()
let app = buildApplication(args)
try await app.test(.router) { client in
try await client.XCTExecute(uri: "/health", method: .get) { response in
try await client.execute(uri: "/health", method: .get) { response in
XCTAssertEqual(response.status, .ok)
}
}
Expand Down

0 comments on commit abc6ccc

Please sign in to comment.