Add .unhandled route

This commit is contained in:
Alex Hultman
2018-10-03 18:35:20 +02:00
parent 0d932e9649
commit d4ca158495
5 changed files with 22 additions and 4 deletions
+5 -1
View File
@@ -12,11 +12,15 @@ 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("/*", [asyncFileStreamer](auto *res, auto *req) {
}*/).get("/hello", [asyncFileStreamer](auto *res, auto *req) {
// depending on the file type we want to also add mime!
asyncFileStreamer->streamFile(res, req->getUrl());
}).unhandled([](auto *res, auto *req) {
res->end("Here's nothing for you to see!");
}).listen(3000, [](auto *token) {
if (token) {
std::cout << "Listening on port " << 3000 << std::endl;