File tree Expand file tree Collapse file tree 4 files changed +61
-10
lines changed Expand file tree Collapse file tree 4 files changed +61
-10
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ let package = Package(
2020 name: " hello-world " ,
2121 platforms: [ . macOS( . v13) ] ,
2222 dependencies: [
23- . package ( url: " https://github.com/vapor/vapor " , . upToNextMajor ( from: " 4.102.0 " ) ) ,
24- . package ( url: " https://github.com/apple/swift-container-plugin " , from: " 0.4 .0 " ) ,
23+ . package ( url: " https://github.com/vapor/vapor " , from: " 4.102.0 " ) ,
24+ . package ( url: " https://github.com/apple/swift-container-plugin " , from: " 0.5 .0 " ) ,
2525 ] ,
2626 targets: [ . executableTarget( name: " hello-world " , dependencies: [ . product( name: " Vapor " , package : " vapor " ) ] ) ]
2727)
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // This source file is part of the SwiftContainerPlugin open source project
4+ //
5+ // Copyright (c) 2025 Apple Inc. and the SwiftContainerPlugin project authors
6+ // Licensed under Apache License v2.0
7+ //
8+ // See LICENSE.txt for license information
9+ // See CONTRIBUTORS.txt for the list of SwiftContainerPlugin project authors
10+ //
11+ // SPDX-License-Identifier: Apache-2.0
12+ //
13+ //===----------------------------------------------------------------------===//
14+
15+ import Vapor
16+
17+ func configure( _ app: Application ) async throws {
18+ try routes ( app)
19+ }
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // This source file is part of the SwiftContainerPlugin open source project
4+ //
5+ // Copyright (c) 2025 Apple Inc. and the SwiftContainerPlugin project authors
6+ // Licensed under Apache License v2.0
7+ //
8+ // See LICENSE.txt for license information
9+ // See CONTRIBUTORS.txt for the list of SwiftContainerPlugin project authors
10+ //
11+ // SPDX-License-Identifier: Apache-2.0
12+ //
13+ //===----------------------------------------------------------------------===//
14+
15+ import Vapor
16+
17+ @main
18+ enum Entrypoint {
19+ static func main( ) async throws {
20+ let env = try Environment . detect ( )
21+ let app = try await Application . make ( env)
22+ app. http. server. configuration. hostname = " 0.0.0.0 "
23+
24+ do {
25+ try await configure ( app)
26+ try await app. execute ( )
27+ } catch {
28+ app. logger. report ( error: error)
29+ try ? await app. asyncShutdown ( )
30+ throw error
31+ }
32+ try await app. asyncShutdown ( )
33+ }
34+ }
Original file line number Diff line number Diff line change 22//
33// This source file is part of the SwiftContainerPlugin open source project
44//
5- // Copyright (c) 2024 Apple Inc. and the SwiftContainerPlugin project authors
5+ // Copyright (c) 2025 Apple Inc. and the SwiftContainerPlugin project authors
66// Licensed under Apache License v2.0
77//
88// See LICENSE.txt for license information
@@ -17,10 +17,8 @@ import Vapor
1717
1818let myos = ProcessInfo . processInfo. operatingSystemVersionString
1919
20- let app = try Application ( . detect( ) )
21- app. http. server. configuration. hostname = " 0.0.0.0 "
22- defer { app. shutdown ( ) }
23-
24- app. get { _ in " Hello World, from Vapor on \( myos) \n " }
25-
26- try app. run ( )
20+ func routes( _ app: Application ) throws {
21+ app. get { req async in
22+ " Hello World, from Vapor on \( myos) \n "
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments