VWeb/example/main.cpp
2022-08-23 16:40:57 +02:00

20 lines
406 B
C++

#include <VWeb.h>
bool Ping(const VWeb::Request&, VWeb::Response& response) {
response << "Pong";
return true;
}
int main() {
using namespace VWeb;
VWeb::Server server;
auto& router = server.GetRouter();
router->Get("/test", [](const Request&, Response& response) {
response << "NICE";
return true;
});
router->Get("/ping", &Ping);
server.Start();
server.Join();
return 0;
}