Commit 6aebf428 authored by lillypad's avatar lillypad

c++ 11 override and whitespace

parent 2ab2b548
...@@ -69,14 +69,13 @@ Some other CMAKE defines: ...@@ -69,14 +69,13 @@ Some other CMAKE defines:
using namespace Pistache; using namespace Pistache;
struct HelloHandler : public Http::Handler { struct HelloHandler : public Http::Handler {
HTTP_PROTOTYPE(HelloHandler) HTTP_PROTOTYPE(HelloHandler)
void onRequest(const Http::Request&, Http::ResponseWriter writer) override{
void onRequest(const Http::Request& request, Http::ResponseWriter writer) { writer.send(Http::Code::Ok, "Hello, World!");
writer.send(Http::Code::Ok, "Hello, World!"); }
}
}; };
int main() { int main() {
Http::listenAndServe<HelloHandler>("*:9080"); Http::listenAndServe<HelloHandler>("*:9080");
} }
``` ```
...@@ -14,7 +14,7 @@ public: ...@@ -14,7 +14,7 @@ public:
HTTP_PROTOTYPE(HelloHandler) HTTP_PROTOTYPE(HelloHandler)
void onRequest(const Http::Request& request, Http::ResponseWriter response) { void onRequest(const Http::Request& request, Http::ResponseWriter response) override{
UNUSED(request); UNUSED(request);
response.send(Pistache::Http::Code::Ok, "Hello World\n"); response.send(Pistache::Http::Code::Ok, "Hello World\n");
} }
......
/* /*
Mathieu Stefani, 07 février 2016 Mathieu Stefani, 07 février 2016
* Http client example * Http client example
*/ */
......
/* /*
Mathieu Stefani, 07 février 2016 Mathieu Stefani, 07 février 2016
Example of a REST endpoint with routing Example of a REST endpoint with routing
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment