#include "VWeb-1.0/VWeb.h" class MyCompleteController : public VWeb::Route { public: bool Get(const VWeb::Request&, VWeb::Response& response) { response << "MyCompleteController: GET"; return true; } bool Post(const VWeb::Request&, VWeb::Response& response) { response << "MyCompleteController: POST"; return true; } bool IsAllowed(const VWeb::Request& request) { return request.HasHeader("Auth"); } }; bool Ping(const VWeb::Request&, VWeb::Response& response) { response << "Pong"; return true; } int main() { using namespace VWeb; VWeb::Server server; auto& router = server.GetRouter(); // For debugging and profiling more than 1 thread can be hard. server.GetServerConfig()->WorkerThreads = 1; router->Get("/test", [](const Request&, Response& response) { response << "NICE"; return true; }); router->Get("/ping", &Ping); server.Start(); server.Join(); return 0; }