The click action now allows all methods & sends the request controller

This commit is contained in:
2023-01-08 03:58:19 +01:00
parent 080d646e86
commit fd24a2ca82

View File

@ -4,7 +4,7 @@ const app = require('express').Router();
const sendNotFound = (res) => res.status(404).render(process.cwd() + "/server/templates/404");
app.get("/", async (req, res) => {
app.all("/", async (req, res) => {
res.locals.accessId = req.baseUrl.substring(1, req.baseUrl.length) || "home";
const currentDomain = req.get('host') || "localhost";
@ -18,7 +18,7 @@ app.get("/", async (req, res) => {
await clickLink(link.accessId, link.domainName);
res.locals.meta = JSON.parse(link.meta);
module.onClick(link.id, link.accessId, JSON.parse(link.meta), res);
module.onClick(link.id, link.accessId, JSON.parse(link.meta), res, req);
});
module.exports = app;
module.exports = app;