neutral/routes/link.js

23 lines
480 B
JavaScript
Raw Normal View History

2023-11-05 11:12:18 +00:00
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;
}
}