Skip to content

Commit d0ee257

Browse files
committed
Merge branch 'develop'
2 parents 597592e + 01cf7a7 commit d0ee257

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717

1818
dependencies: [
1919
.package(url: "https://github.com/Macro-swift/Macro.git",
20-
from: "1.0.10"),
20+
from: "1.0.14"),
2121
.package(url: "https://github.com/AlwaysRightInstitute/mustache.git",
2222
from: "1.0.2")
2323
],

Sources/express/Express.swift

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,11 @@ import func http.createServer
430430
public extension Express {
431431

432432
/**
433-
* Create an HTTP server (using http.server) with the `Express` instance
434-
* as the handler, and then start listening.
433+
* Create an HTTP server (using `http.createServer`) with the ``Express``
434+
* instance as the handler, and then start listening.
435+
*
436+
* Returns the `http.Server`, so that additional event handlers
437+
* can be registered (e.g. `onError`, `onListening`).
435438
*
436439
* - Parameters:
437440
* - port : The port the server should listen on.
@@ -445,16 +448,22 @@ public extension Express {
445448
@discardableResult
446449
func listen(_ port: Int? = nil, _ host: String = "0.0.0.0",
447450
backlog: Int = 512,
448-
onListening execute: (( http.Server ) -> Void)? = nil) -> Self
451+
onListening execute: (( http.Server ) -> Void)? = nil)
452+
-> http.Server
449453
{
450454
let server = http.createServer(handler: requestHandler)
451-
_ = server.listen(port, host, backlog: backlog, onListening: execute)
452-
return self
455+
_ = server.listen(port, host, backlog: backlog,
456+
onListening: execute)
457+
return server
453458
}
454459

455460
/**
456-
* Create an HTTP server (using http.server) with the `Express` instance
457-
* as the handler, and then start listening.
461+
* Create an HTTP server (using `http.createServer`) with the ``Express``
462+
* instance as the handler, and then start listening.
463+
*
464+
* Returns the `http.Server`, so that additional event handlers
465+
* can be registered (e.g. `onError`, `onListening`).
466+
*
458467
*
459468
* - Parameters:
460469
* - port : The port the server should listen on.
@@ -467,7 +476,7 @@ public extension Express {
467476
@inlinable
468477
@discardableResult
469478
func listen(_ port: Int?, _ host: String = "0.0.0.0", backlog: Int = 512,
470-
onListening execute: @escaping () -> Void) -> Self
479+
onListening execute: @escaping () -> Void) -> http.Server
471480
{
472481
return listen(port, host, backlog: backlog) { _ in execute() }
473482
}

0 commit comments

Comments
 (0)