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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Commands-Creator/routes/index.js

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;