Renamed the "archivesFolder" property for the AppBuilder builder in the library target as "folderArchives".
This commit is contained in:
parent
fa50c77421
commit
08d296ef1a
@ -11,10 +11,7 @@ struct App: AsyncParsableCommand {
|
|||||||
// MARK: Functions
|
// MARK: Functions
|
||||||
|
|
||||||
mutating func run() async throws {
|
mutating func run() async throws {
|
||||||
let appBuilder = AppBuilder(
|
let appBuilder = AppBuilder(appName: "Doxy")
|
||||||
appName: "Doxy",
|
|
||||||
archivesFolder: "Resources/Archives"
|
|
||||||
)
|
|
||||||
|
|
||||||
let app = try await appBuilder(options)
|
let app = try await appBuilder(options)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ public struct AppBuilder {
|
|||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
private let appName: String
|
private let appName: String
|
||||||
private let archivesFolder: String
|
private let folderArchives: String
|
||||||
private let environment: Environment
|
private let environment: Environment
|
||||||
|
|
||||||
// MARK: Initialisers
|
// MARK: Initialisers
|
||||||
@ -15,13 +15,13 @@ public struct AppBuilder {
|
|||||||
/// Initialises this type.
|
/// Initialises this type.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - appName: A name for the app to build.
|
/// - 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(
|
public init(
|
||||||
appName: String,
|
appName: String,
|
||||||
archivesFolder: String
|
folderArchives: String = "Resources/Archives"
|
||||||
) {
|
) {
|
||||||
self.appName = appName
|
self.appName = appName
|
||||||
self.archivesFolder = archivesFolder
|
self.folderArchives = folderArchives
|
||||||
self.environment = Environment()
|
self.environment = Environment()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ public struct AppBuilder {
|
|||||||
/// Sets and builds a ready-to-use application.
|
/// Sets and builds a ready-to-use application.
|
||||||
///
|
///
|
||||||
/// The application this function builds have the following features:
|
/// 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.
|
/// * 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.
|
/// - Parameter arguments: A set in input parameters used while building the application.
|
||||||
@ -76,10 +76,10 @@ private extension AppBuilder {
|
|||||||
|
|
||||||
router.addMiddleware {
|
router.addMiddleware {
|
||||||
LogRequestsMiddleware(logger.logLevel)
|
LogRequestsMiddleware(logger.logLevel)
|
||||||
DocCMiddleware(archivesFolder)
|
DocCMiddleware(folderArchives)
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchiveController().register(to: router)
|
ArchiveController(folderArchives).register(to: router)
|
||||||
|
|
||||||
return router
|
return router
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user