updated comments
This commit is contained in:
parent
65d267963d
commit
7fc1b1bf20
1 changed files with 2 additions and 1 deletions
1
main.cpp
1
main.cpp
|
|
@ -51,6 +51,7 @@ int main() {
|
|||
};
|
||||
|
||||
//GET-example for the path /match/[number], responds with the matched string in path (number)
|
||||
//For instance a request GET /match/123 will receive: 123
|
||||
httpserver.resources["^/match/([0-9]*)/?$"]["^GET$"]=[](ostream& response, const Request& request, const smatch& path_match) {
|
||||
string number=path_match[1];
|
||||
response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length() << "\r\n\r\n" << number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue