Hook up req->getParameter

This commit is contained in:
Alex Hultman
2018-10-05 00:10:43 +02:00
parent be0eb69597
commit 5e5d0de0e9
4 changed files with 29 additions and 21 deletions
+7 -6
View File
@@ -16,24 +16,25 @@ int main(int argc, char **argv) {
res->end("GET /WILDCARD");
})*/.get("/:param1/:param2", [](auto *res, auto *req/*, auto &params*/) {
})*/.get("/:param1/:param2", [](auto *res, auto *req) {
// todo: read from params (req->getParameter(0))
res->write("GET /:param1/:param2 = ");
res->end(req->getUrl());
res->write(req->getParameter(0));
res->write(" and ");
res->end(req->getParameter(1));
}).post("/hello", [asyncFileStreamer](auto *res, auto *req/*, auto &params*/) {
}).post("/hello", [asyncFileStreamer](auto *res, auto *req) {
// depending on the file type we want to also add mime!
//asyncFileStreamer->streamFile(res, req->getUrl());
res->end("POST /hello");
}).get("/hello", [](auto *res, auto *req/*, auto &params*/) {
}).get("/hello", [](auto *res, auto *req) {
res->end("GET /hello");
}).unhandled([](auto *res, auto *req/*, auto &params*/) {
}).unhandled([](auto *res, auto *req) {
res->end("Here's nothing for you to see!");