mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-14 16:58:30 +00:00
Fixed variable capture problem.
This commit is contained in:
parent
bad43c66d7
commit
ace3bb6caf
2 changed files with 7 additions and 1 deletions
|
@ -47,6 +47,8 @@ std::string dump_request(Context& cxt)
|
|||
int main(void)
|
||||
{
|
||||
if (true) {
|
||||
const char* s = "abcde";
|
||||
|
||||
// DSL style
|
||||
HTTP_SERVER("localhost", 1234) {
|
||||
|
||||
|
@ -57,6 +59,10 @@ int main(void)
|
|||
GET("/home", {
|
||||
res.set_content(dump_request(cxt));
|
||||
});
|
||||
|
||||
GET("/abcde", {
|
||||
res.set_content(s);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Regular style
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue