404 page should not be an error, but a full default response
This commit is contained in:
@@ -216,6 +216,12 @@ public:
|
||||
|
||||
TemplatedApp(SocketContextOptions options = {}) {
|
||||
httpContext = HttpContext<SSL>::create(Loop::get(), options);
|
||||
|
||||
/* Register default handler for 404 (can be overridden by user) */
|
||||
this->any("/*", [](auto *res, auto */*req*/) {
|
||||
res->writeStatus("404 File Not Found");
|
||||
res->end("<html><body><h1>File Not Found</h1><hr><i>uWebSockets/20 Server</i></body></html>");
|
||||
});
|
||||
}
|
||||
|
||||
bool constructorFailed() {
|
||||
|
||||
Reference in New Issue
Block a user