Add server content data and mountableserver

This commit is contained in:
2025-01-12 19:32:19 -06:00
parent c80a5c503a
commit 4ce3526047
11 changed files with 265 additions and 19 deletions

View File

@@ -0,0 +1,22 @@
#include "TessesFramework/Http/CallbackServer.hpp"
namespace Tesses::Framework::Http
{
CallbackServer::CallbackServer(std::function<bool(ServerContext&)> cb) : CallbackServer(cb,[]()->void{})
{
}
CallbackServer::CallbackServer(std::function<bool(ServerContext&)> cb,std::function<void()> destroy)
{
this->cb = cb;
this->destroy=destroy;
}
bool CallbackServer::Handle(ServerContext& ctx)
{
return this->cb(ctx);
}
CallbackServer::~CallbackServer()
{
this->destroy();
}
}