1
0
mirror of synced 2025-07-20 16:02:59 +03:00

Renamed Context to Connection. Removed DSL macro.

This commit is contained in:
yhirose
2012-09-27 21:05:36 -04:00
parent 6897c64c74
commit ced9c38339
5 changed files with 53 additions and 57 deletions

View File

@ -11,13 +11,17 @@ Server Example
Inspired by [Sinatra](http://www.sinatrarb.com/)
#include <httplib.h>
using namespace httplib;
int main(void) {
HTTP_SERVER("localhost", 1234) {
GET("/hi", {
res.set_content("Hello World!");
});
}
int main(void)
{
Server svr("localhost", 1234);
svr.get("/hi", [](Connection& c) {
c.response.set_content("Hello World!");
});
svr.run();
}
Copyright (c) 2012 Yuji Hirose. All rights reserved.