You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
408 B
19 lines
408 B
var express = require('express');
|
|
var router = express.Router();
|
|
const commands = require('../public/json/commands.json')
|
|
|
|
router.get('/', (req, res) => {
|
|
res.render('index');
|
|
});
|
|
|
|
Object.keys(commands).forEach(command => {
|
|
router.get(`/${command}`, (req, res) => {
|
|
console.log("User is visiting " + req.url)
|
|
res.render('commands', {
|
|
title: command
|
|
})
|
|
})
|
|
})
|
|
|
|
module.exports = router;
|