Added syntax highlight to samples.

This commit is contained in:
yhirose 2015-02-06 22:43:06 -05:00
parent 79bb0be0ca
commit de645fffc0

View file

@ -12,6 +12,7 @@ Server Example
Inspired by [Sinatra](http://www.sinatrarb.com/) and [express](https://github.com/visionmedia/express).
```c++
#include <httplib.h>
int main(void)
@ -24,12 +25,19 @@ Inspired by [Sinatra](http://www.sinatrarb.com/) and [express](https://github.co
res.set_content("Hello World!", "text/plain");
});
svr_.get("/numbers/(\d+)", [&](const auto& req, auto& res) {
string numbers = req.matches[1];
res.set_content(numbers, "text/plain");
});
svr.listen("localhost", 1234);
}
```
Client Example
--------------
```c++
#include <httplib.h>
#include <iostream>
@ -42,5 +50,6 @@ Client Example
std::cout << res->body << std::endl;
}
}
```
Copyright (c) 2014 Yuji Hirose. All rights reserved.