 }
 
 extension RouterBuilder {
-    public func compose(_ path: String = "", middleware: Middleware..., router: Router) {
+    public func compose(_ path: String = "", middleware: Middleware..., router: HTTP.Router) {
         let prefix = self.path + path
-        let prefixPathComponentsCount = router.splitPathIntoComponents(prefix).count
+
+        let prefixPathComponentsCount = prefix.split(separator: "/").count
 
         for route in router.routes {
             for (method, _) in route.actions {

    }
}

extension Router {
    public func splitPathIntoComponents(_ path: String) -> [String] {
        return path.split(separator: "/")
    }

    public func mergePathComponents(_ components: [String]) -> String {
        return "/" + components.joined(separator: "/")
    }
}


                            return Response(status: .badRequest)
                        }

                        let requestPathComponents = path.split(separator: "/")
                        let shortenedRequestPathComponents = requestPathComponents.dropFirst(prefixPathComponentsCount)
                        let shortenedPath = "/" + shortenedRequestPathComponents.joined(separator: "/")

                        request.uri.path = shortenedPath
                        return try router.respond(to: request)
