FlyingFox
FlyingFox copied to clipboard
Abilities to insert or delete the handlers in RoutedHTTPHandler
We currently only support for
public mutating func appendRoute(_ route: HTTPRoute, to handler: HTTPHandler) {
handlers.append((route, handler))
}
public mutating func appendRoute(_ route: HTTPRoute,
handler: @Sendable @escaping (HTTPRequest) async throws -> HTTPResponse) {
handlers.append((route, ClosureHTTPHandler(handler)))
}
Can we also have the function that inserts at 0 or remove all handlers. The scenario we encounter is that we use it on the UI test, while we need to mock a response change, we will need to change the handlers array to make it happen, if append is the only function, we will need to rebuild a server again to make the change.