mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Add tests for static routes + support server.reload for static routes (#13643)
This commit is contained in:
@@ -514,6 +514,13 @@ public:
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
void clearRoutes() {
|
||||
if (httpContext) {
|
||||
httpContext->getSocketContextData()->clearRoutes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TemplatedApp &&head(std::string pattern, MoveOnlyFunction<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
|
||||
if (httpContext) {
|
||||
httpContext->onHttp("HEAD", pattern, std::move(handler));
|
||||
|
||||
@@ -50,6 +50,13 @@ private:
|
||||
void *upgradedWebSocket = nullptr;
|
||||
bool isParsingHttp = false;
|
||||
bool rejectUnauthorized = false;
|
||||
|
||||
// TODO: SNI
|
||||
void clearRoutes() {
|
||||
this->router = HttpRouter<RouterData>{};
|
||||
this->currentRouter = &router;
|
||||
filterHandlers.clear();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user