|
|
@@ -9,6 +9,7 @@ const path = require("path");
|
|
|
const hbs = require("hbs");
|
|
|
|
|
|
const helpers = require("./handlers/helpers.handler");
|
|
|
+const renders = require("./handlers/renders.handler");
|
|
|
const asyncHandler = require("./utils/asyncHandler");
|
|
|
const locals = require("./handlers/locals.handler");
|
|
|
const links = require("./handlers/links.handler");
|
|
|
@@ -59,6 +60,9 @@ app.use("/api", routes.api);
|
|
|
// finally, redirect the short link to the target
|
|
|
app.get("/:id", asyncHandler(links.redirect));
|
|
|
|
|
|
+// 404 pages that don't exist
|
|
|
+app.get("*", renders.notFound);
|
|
|
+
|
|
|
// handle errors coming from above routes
|
|
|
app.use(helpers.error);
|
|
|
|