32 lines
873 B
C++
32 lines
873 B
C++
#pragma once
|
|
|
|
#include "Http.h"
|
|
#include "Request.h"
|
|
#include "Response.h"
|
|
|
|
#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);
|
|
|
|
void SetAllowedMethods(uint32_t methods);
|
|
[[nodiscard]] uint32_t GetAllowedMethods() const;
|
|
|
|
protected:
|
|
uint32_t m_AllowedMethods = 0;
|
|
friend Router;
|
|
};
|
|
} // namespace VWeb
|