diff options
| author | Per Larsson <[email protected]> | 2021-09-28 15:09:15 +0200 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-09-28 15:09:15 +0200 |
| commit | 141317786f9d59e95da8316ce40cf30e4dfd7b53 (patch) | |
| tree | 3c863384c6ca68a30e82989994408c5f40159273 /zenserver/testing/httptest.cpp | |
| parent | Removed using the bucket name to detect binary cache records and store conten... (diff) | |
| parent | apply: Re-enabled environment variable setup for child processes (diff) | |
| download | zen-141317786f9d59e95da8316ce40cf30e4dfd7b53.tar.xz zen-141317786f9d59e95da8316ce40cf30e4dfd7b53.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zenserver/testing/httptest.cpp')
| -rw-r--r-- | zenserver/testing/httptest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zenserver/testing/httptest.cpp b/zenserver/testing/httptest.cpp index c4fd6003c..18d63a6ef 100644 --- a/zenserver/testing/httptest.cpp +++ b/zenserver/testing/httptest.cpp @@ -2,6 +2,7 @@ #include "httptest.h" +#include <zencore/compactbinarybuilder.h> #include <zencore/compactbinarypackage.h> namespace zen { @@ -14,6 +15,16 @@ HttpTestingService::HttpTestingService() HttpVerb::kGet); m_Router.RegisterRoute( + "json", + [this](HttpRouterRequest& Req) { + CbObjectWriter Obj; + Obj.AddBool("ok", true); + Obj.AddInteger("counter", ++m_Counter); + Req.ServerRequest().WriteResponse(HttpResponseCode::OK, Obj.Save()); + }, + HttpVerb::kGet); + + m_Router.RegisterRoute( "echo", [this](HttpRouterRequest& Req) { IoBuffer Body = Req.ServerRequest().ReadPayload(); |