diff options
| author | Stefan Boberg <[email protected]> | 2021-09-08 21:38:20 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-08 21:38:20 +0200 |
| commit | 74eeda8aa9c67ca9820b8f7dd98bc2da3f97748a (patch) | |
| tree | d3b55f48abd50665eb4ec7f5022885061b2f604a /zenserver/testing/httptest.h | |
| parent | Log spawned process name (diff) | |
| download | zen-74eeda8aa9c67ca9820b8f7dd98bc2da3f97748a.tar.xz zen-74eeda8aa9c67ca9820b8f7dd98bc2da3f97748a.zip | |
Introduced dedicated HTTP testing service, used during development to exercise the server framework
Diffstat (limited to 'zenserver/testing/httptest.h')
| -rw-r--r-- | zenserver/testing/httptest.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/zenserver/testing/httptest.h b/zenserver/testing/httptest.h new file mode 100644 index 000000000..236d17ce7 --- /dev/null +++ b/zenserver/testing/httptest.h @@ -0,0 +1,34 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include <zencore/httpserver.h> + +#include <spdlog/spdlog.h> + +namespace zen { + +/** + * Test service to facilitate testing the HTTP framework and client interactions + */ +class HttpTestingService : public HttpService +{ +public: + HttpTestingService(); + ~HttpTestingService(); + + virtual const char* BaseUri() const override; + virtual void HandleRequest(HttpServerRequest& Request) override; + +private: + HttpRequestRouter m_Router; + + struct PackageHandler : public PackageEndpointHandler + { + virtual void HandleRequest(HttpRouterRequest& Request) override; + }; + + PackageHandler m_PackageHandler; +}; + +} // namespace zen |