Fix up router, add .post route

This commit is contained in:
Alex Hultman
2018-10-03 19:36:46 +02:00
parent d4ca158495
commit 7d06bef485
5 changed files with 48 additions and 19 deletions
+12 -2
View File
@@ -12,10 +12,20 @@ int main(int argc, char **argv) {
.cert_file_name = "/home/alexhultman/uWebSockets/misc/ssl/cert.pem",
.dh_params_file_name = "/home/alexhultman/dhparams.pem",
.passphrase = "1234"
}*/).get("/hello", [asyncFileStreamer](auto *res, auto *req) {
}*/).get("/*", [](auto *res, auto *req) {
res->end("GET /WILDCARD");
}).post("/hello", [asyncFileStreamer](auto *res, auto *req) {
// depending on the file type we want to also add mime!
asyncFileStreamer->streamFile(res, req->getUrl());
//asyncFileStreamer->streamFile(res, req->getUrl());
res->end("POST /hello");
}).get("/hello", [](auto *res, auto *req) {
res->end("GET /hello");
}).unhandled([](auto *res, auto *req) {