The click action now allows all methods & sends the request controller
This commit is contained in:
@ -4,7 +4,7 @@ const app = require('express').Router();
|
|||||||
|
|
||||||
const sendNotFound = (res) => res.status(404).render(process.cwd() + "/server/templates/404");
|
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";
|
res.locals.accessId = req.baseUrl.substring(1, req.baseUrl.length) || "home";
|
||||||
const currentDomain = req.get('host') || "localhost";
|
const currentDomain = req.get('host') || "localhost";
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ app.get("/", async (req, res) => {
|
|||||||
await clickLink(link.accessId, link.domainName);
|
await clickLink(link.accessId, link.domainName);
|
||||||
|
|
||||||
res.locals.meta = JSON.parse(link.meta);
|
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;
|
||||||
|
Reference in New Issue
Block a user