REST Service for POPCORN - ILIAS
alex
2025-06-20 eda54046a40c108e993cb8efd73a1a36bcbfd225
app.js
@@ -37,7 +37,8 @@
const searchLib = require("./lib/search")
searchLib.doIndex().catch(console.error)
fastify.get("/api/search/user", async function (req, res) {
fastify
   .get("/api/search/user", async function (req, res) {
   console.log(req.query)
   const search = req.query?.search
   if (!search) {
@@ -49,6 +50,15 @@
      return res.send(data)
   }
})
   .post("/api/search/reindex", async function (req, res) {
      console.log("REINDEX ++++")
      const start = Date.now()
      await searchLib.doIndex().catch(console.error)
      return res.send({
         status: "ok",
         msg: `reindexed in ${Date.now() - start} ms`,
      })
   })
fastify
   /////// USER ////////////////////////////////////////////////////////////////