From 3593b547fa41fb227aa76c4abbbb4808d1007dab Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 20 Oct 2022 17:22:48 +0200 Subject: [PATCH] from da web to searches!!! --- server.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.js b/server.js index b0aabac8..46f3a816 100644 --- a/server.js +++ b/server.js @@ -431,10 +431,15 @@ app.get("/search", async (req, res) => { return res.redirect("/"); } + const summary = await wiki + .summary(query + "") + .then((summary_) => (summary_.title !== "Not found." ? summary_ : "none")); + renderTemplate(res, req, "search.ejs", { j, continuation, q: query, + summary }); });