From f454cc80e4de1e59d134950f29d7c138f2db33c7 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Sun, 4 Sep 2022 15:40:52 +0200 Subject: [PATCH] Set port through configuration --- Sources/App/ServerConfiguration.swift | 2 ++ Sources/App/configure.swift | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Sources/App/ServerConfiguration.swift b/Sources/App/ServerConfiguration.swift index 9fd5508..d3212d3 100644 --- a/Sources/App/ServerConfiguration.swift +++ b/Sources/App/ServerConfiguration.swift @@ -2,6 +2,8 @@ import Foundation struct ServerConfiguration: Codable { + let port: Int + let logPath: String let privateKeyFilePath: String diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index 298457f..bbcef50 100644 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -27,6 +27,8 @@ public func configure(_ app: Application) throws { return } + app.http.server.configuration.port = config.port + guard configureAPNS(config) else { return }