16 lines
452 B
C
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; }
|
||
|
};
|
||
|
}
|