pica/handler/handler.h

30 lines
554 B
C
Raw Normal View History

2023-12-30 22:42:11 +00:00
//SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
//SPDX-License-Identifier: GPL-3.0-or-later
2023-12-13 20:33:11 +00:00
#pragma once
#include <string>
#include <memory>
#include "request/request.h"
#include "response/response.h"
namespace Handler {
class Handler {
protected:
Handler(const std::string& path, Request::Method method);
2024-01-21 19:23:48 +00:00
protected:
static void error (Request& request, Response::Status status);
2023-12-13 20:33:11 +00:00
public:
virtual ~Handler();
virtual void handle(Request& request) = 0;
const std::string path;
const Request::Method method;
};
}