mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-27 20:58:28 +00:00
Renamed Context to Connection. Removed DSL macro.
This commit is contained in:
1 parent
6897c64c74
commit
ced9c38339
5 files changed
+53
-57
No files matched your search
@@ -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.
|
||||
Reference in new issue
Block a user