drogon/examples/simple_example/TestController.h

24 lines
691 B
C
Raw Normal View History

2018-05-14 08:57:40 +00:00
#pragma once
#include <drogon/HttpSimpleController.h>
using namespace drogon;
2018-10-14 07:56:54 +00:00
namespace example
{
class TestController : public drogon::HttpSimpleController<TestController>
{
2019-01-02 10:49:37 +00:00
public:
virtual void asyncHandleHttpRequest(const HttpRequestPtr &req, std::function<void(const HttpResponsePtr &)> &&callback) override;
2019-01-02 10:49:37 +00:00
PATH_LIST_BEGIN
//list path definations here;
//PATH_ADD("/path","filter1","filter2",...);
2019-04-12 13:45:43 +00:00
PATH_ADD("/", Get);
2019-01-02 10:49:37 +00:00
PATH_ADD("/Test", "nonFilter");
2019-04-12 13:45:43 +00:00
PATH_ADD("/tpost", Post, Options);
2019-01-02 10:49:37 +00:00
PATH_ADD("/slow", "TimeFilter", Get);
PATH_LIST_END
2019-01-25 08:46:20 +00:00
TestController()
{
LOG_DEBUG << "TestController constructor";
}
2018-10-14 07:56:54 +00:00
};
} // namespace example