mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-09 00:05:46 +00:00
Add server content data and mountableserver
This commit is contained in:
22
src/Http/CallbackServer.cpp
Normal file
22
src/Http/CallbackServer.cpp
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user