neutral/routes/link.js
Raphix adfb626dd7
All checks were successful
Neutral/pipeline/head This commit looks good
Version 0.3.3 - Add of links
2023-11-05 12:12:18 +01:00

23 lines
480 B
JavaScript

var express = require('express');
var router = express.Router();
var path = require("path")
module.exports = router;
module.exports.ApplyLinks = class {
constructor(links) {
// Remove all routes
router.stack = []
for(var link of links) {
const url = link.url
router.get("/" + link.dest, (req,res,next) => {
res.redirect(302, url)
})
}
module.exports = router;
}
}