Files
ccn/Services/Website/Sources/Library/Public/Extensions/NotFoundMiddleware+Defaults.swift
T

26 lines
801 B
Swift
Raw Normal View History

2026-08-19 22:55:00 +02:00
import Foundation
import Infrastructure
public extension NotFoundMiddleware {
// MARK: Initializers
2026-09-04 13:40:35 +00:00
/// Creates a not-found middleware that renders the website's not-found page, localized to the module's String Catalog languages.
2026-08-19 22:55:00 +02:00
/// - Parameters:
/// - assetVersion: the version token appended to the page's asset URLs, or `nil` (the default) to leave them unversioned.
2026-09-04 13:40:35 +00:00
/// - analytics: the analytics tracker the page embeds, or `nil` (the default) to omit the tracker script.
2026-08-19 22:55:00 +02:00
init(
assetVersion: String? = nil,
analytics: Analytics? = nil
) {
self.init(bundle: .module) {
NotFoundPage(
locale: $0,
assetVersion: assetVersion,
analytics: analytics
)
}
}
}