VWeb/Includes/MiddleWare.h
Maurice Grönwoldt 5bb68a7d02 Split VWeb into smaller headers
We have no make install support... so we don't need to have everything as a single-header and lib file.
2023-09-16 16:29:03 +02:00

16 lines
452 B
C++

#pragma once
#include <optional>
#include "Response.h"
#include "Request.h"
namespace VWeb {
typedef std::optional<Ref<Response>> PreMiddleWareReturn;
struct MiddleWare {
int Pos{0};
virtual PreMiddleWareReturn PreHandle(Request &) { return {}; }
virtual bool PostHandle(Request &, Response &) { return true; }
virtual void Shutdown(Request &, const Response &){};
bool operator<(const MiddleWare *rhs) const { return Pos < rhs->Pos; }
};
}