gaspan619

hello_word.cc

Sep 5th, 2019
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <pistache/endpoint.h>
  2.  
  3. using namespace Pistache;
  4.  
  5. struct HelloHandler : public Http::Handler {
  6.   HTTP_PROTOTYPE(HelloHandler)
  7.   void onRequest(const Http::Request&, Http::ResponseWriter writer) override{
  8.     writer.send(Http::Code::Ok, "Hello, World!");
  9.   }
  10. };
  11.  
  12. int main() {
  13.   Http::listenAndServe<HelloHandler>("*:9080");
  14. }
Advertisement
Add Comment
Please, Sign In to add comment