JaBa/dashboard/routes/commands.js

19 lines
473 B
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const express = require("express"),
router = express.Router(),
fs = require("fs"),
marked = require("marked");
router.get("/", function (req, res) {
2021-12-10 21:39:54 +05:00
var md = function (filename) {
return marked.parse(fs.readFileSync("./dashboard/views/docs/" + filename, "utf8"));
};
res.render("commands", {
user: req.userInfos,
translate: req.translate,
currentURL: `${req.client.config.dashboard.baseURL}/${req.originalUrl}`,
"md": md
});
});
module.exports = router;