diff --git a/App/Sources/App.swift b/App/Sources/App.swift index a4824cf..5976a69 100644 --- a/App/Sources/App.swift +++ b/App/Sources/App.swift @@ -11,10 +11,7 @@ struct App: AsyncParsableCommand { // MARK: Functions mutating func run() async throws { - let appBuilder = AppBuilder( - appName: "Doxy", - archivesFolder: "Resources/Archives" - ) + let appBuilder = AppBuilder(appName: "Doxy") let app = try await appBuilder(options) diff --git a/Library/Sources/Public/Builders/AppBuilder.swift b/Library/Sources/Public/Builders/AppBuilder.swift index 08a4179..2b822a8 100644 --- a/Library/Sources/Public/Builders/AppBuilder.swift +++ b/Library/Sources/Public/Builders/AppBuilder.swift @@ -7,7 +7,7 @@ public struct AppBuilder { // MARK: Properties private let appName: String - private let archivesFolder: String + private let folderArchives: String private let environment: Environment // MARK: Initialisers @@ -15,13 +15,13 @@ public struct AppBuilder { /// Initialises this type. /// - Parameters: /// - appName: A name for the app to build. - /// - archivesFolder: A relative path to the location of the *DocC* archive containers. + /// - folderArchives: A relative path to the location of the *DocC* archive containers. public init( appName: String, - archivesFolder: String + folderArchives: String = "Resources/Archives" ) { self.appName = appName - self.archivesFolder = archivesFolder + self.folderArchives = folderArchives self.environment = Environment() } @@ -30,7 +30,7 @@ public struct AppBuilder { /// Sets and builds a ready-to-use application. /// /// The application this function builds have the following features: - /// * proxy requests to any available *DocC* archive container in the `archivesFolder` location; + /// * proxy requests to any available *DocC* archive container in the `folderArchives` location; /// * log any request to any available *DocC* archive container in the application console. /// /// - Parameter arguments: A set in input parameters used while building the application. @@ -76,10 +76,10 @@ private extension AppBuilder { router.addMiddleware { LogRequestsMiddleware(logger.logLevel) - DocCMiddleware(archivesFolder) + DocCMiddleware(folderArchives) } - ArchiveController().register(to: router) + ArchiveController(folderArchives).register(to: router) return router }