Skip to content

Commit 41b09e3

Browse files
committed
allow passing of configuration
1 parent 125e8a8 commit 41b09e3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/ParseServerSwift/configure.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ import Vapor
44
A helper method for configuring your `ParseServerSwift`. This should only be called once when starting your
55
Vapor app.
66
- parameter app: Core type representing a Vapor application.
7+
- parameter configuration: A `ParseServerConfiguration`. If `nil`, the vapor
8+
environment variables will be used for configuration.
79
*/
8-
public func parseServerSwiftConfigure(_ app: Application) async throws {
10+
public func parseServerSwiftConfigure(
11+
_ app: Application,
12+
configuration: ParseServerConfiguration? = nil
13+
) async throws {
914
// Initialize ParseServerSwift
10-
let configuration = try ParseServerConfiguration(app: app)
15+
let configuration = try configuration ?? ParseServerConfiguration(app: app)
1116
try await ParseServerSwift.initialize(configuration, app: app)
1217

1318
// register routes

0 commit comments

Comments
 (0)