updated comments
This commit is contained in:
parent
65d267963d
commit
7fc1b1bf20
1 changed files with 2 additions and 1 deletions
3
main.cpp
3
main.cpp
|
|
@ -50,7 +50,8 @@ int main() {
|
|||
response << "HTTP/1.1 200 OK\r\nContent-Length: 13\r\n\r\nRoot resource";
|
||||
};
|
||||
|
||||
//GET-example for the path /match/[number], responds with the matched string in path (number)
|
||||
//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