#pragma once #include #include "Response.h" #include "Request.h" namespace VWeb { typedef std::optional> 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; } }; }