diff --git a/server/actions/click.js b/server/actions/click.js index e34a2c5..f7d8bd2 100644 --- a/server/actions/click.js +++ b/server/actions/click.js @@ -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; \ No newline at end of file +module.exports = app;