mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-14 16:58:30 +00:00
Changed to take host-name instead of address.
This commit is contained in:
parent
c5c1c4d412
commit
3fbd3afb6c
2 changed files with 23 additions and 31 deletions
|
@ -23,14 +23,10 @@ int main(void)
|
|||
});
|
||||
|
||||
svr.get("/item/:name", [](Context& cxt) {
|
||||
try {
|
||||
cxt.response.body = cxt.request.params.at("name");
|
||||
} catch (...) {
|
||||
// Error...
|
||||
}
|
||||
cxt.response.body = cxt.request.params.at("name");
|
||||
});
|
||||
|
||||
svr.run("0.0.0.0", 1234);
|
||||
svr.run("localhost", 1234);
|
||||
}
|
||||
|
||||
// vim: et ts=4 sw=4 cin cino={1s ff=unix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue