       .childChannelInitializer { channel in
         channel.pipeline.configureHTTPServerPipeline().then {
           let handlers: [ChannelHandler] = gzip
-            ? [HTTPResponseCompressor(), Handler(middleware)]
-            : [Handler(middleware)]
+            ? [HTTPResponseCompressor(), Handler(baseUrl: baseUrl, middleware: middleware)]
+            : [Handler(baseUrl: baseUrl, middleware: middleware)]
           return channel.pipeline.addHandlers(handlers, first: false)
         }
       }

private final class Handler: ChannelInboundHandler {
  typealias InboundIn = HTTPServerRequestPart

  var request: URLRequest?
  let middleware: Middleware<StatusLineOpen, ResponseEnded, Prelude.Unit, Data>

  init(_ middleware: @escaping Middleware<StatusLineOpen, ResponseEnded, Prelude.Unit, Data>) {
    self.middleware = middleware
  }


public func run(
  _ middleware: @escaping Middleware<StatusLineOpen, ResponseEnded, Prelude.Unit, Data>,
  on port: Int = 8080,
  gzip: Bool = false,
  baseUrl: URL
  ) {

  do {
