#pragma once #include "Http.h" #include #include "Request.h" #include "Response.h" #include namespace VWeb { class Router; class Route { public: Route() = default; virtual ~Route() = default; Route(std::initializer_list); virtual bool Execute(Request &request, Response &response); virtual bool Get(Request &request, Response &response); virtual bool Post(Request &request, Response &response); virtual bool Put(Request &request, Response &response); virtual bool Patch(Request &request, Response &response); virtual bool Delete(Request &request, Response &response); bool Options(Request &request, Response &response); virtual bool Fallback(Request &request, Response &response); bool SupportsMethod(Request &request); virtual bool IsAllowed(Request &request); void AllowMethod(HttpMethod method); protected: bool m_AllowAll{true}; std::vector m_AllowedMethods; friend Router; }; }