Add .unhandled route
This commit is contained in:
+5
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user