You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ g++ ex1.cpp -std=c++11 -O3 -lboost_system -lboost_thread
$ ./a.out
(2015-01-08 13:37:43) [INFO ] Crow/0.1 server is running, local port 8080
crow::SimpleApp is the main class for our HTTP server. It's Simple because SimpleApp doesn't have any middlewares. For details about middleware, see middleware section.
CROW_ROUTE macro registers a handler function for each url pattern. In this case, a HTTP request to url / will return a Hello, World! response with 200 OK status code. Other url returns 404 error.
app instance has several methods to configure the server. For example, .port(number) method changes the listening port and .multithreaded() method turns on multiple thread mode for serving requests.
Finally app.run() is called and Crow starts to serve.