VWeb/Includes/Route.h

32 lines
873 B
C
Raw Normal View History

#pragma once
#include "Http.h"
#include "Request.h"
#include "Response.h"
2024-02-04 13:52:08 +01:00
#include <initializer_list>
#include <vector>
namespace VWeb {
class Router;
class Route {
public:
Route() = default;
virtual ~Route() = default;
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);
virtual bool Fallback(Request &request, Response &response);
virtual bool IsAllowed(Request &request);
2024-02-04 13:52:08 +01:00
void SetAllowedMethods(uint32_t methods);
[[nodiscard]] uint32_t GetAllowedMethods() const;
protected:
2024-02-04 13:52:08 +01:00
uint32_t m_AllowedMethods = 0;
friend Router;
};
2024-02-04 13:52:08 +01:00
} // namespace VWeb