change script for list
This commit is contained in:
parent
43ea7f5308
commit
b2fb9ea911
@ -4,18 +4,7 @@ var router = express.Router();
|
|||||||
|
|
||||||
/* GET home page. */
|
/* GET home page. */
|
||||||
router.get('/', function (req, res, next) {
|
router.get('/', function (req, res, next) {
|
||||||
|
res.render('list', {title: 'List'});
|
||||||
data = {
|
|
||||||
title: 'Movies',
|
|
||||||
scripts: []
|
|
||||||
};
|
|
||||||
|
|
||||||
const f = fs.readdirSync('./public/assets/list/');
|
|
||||||
f.forEach(file => {
|
|
||||||
data.scripts.push("/assets/list/" + file);
|
|
||||||
});
|
|
||||||
|
|
||||||
res.render('list', data);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
@ -1,8 +1,4 @@
|
|||||||
<script src="/assets/elementcreate.js"></script>
|
<script src="/assets/list.js"></script>
|
||||||
|
|
||||||
{{#each scripts}}
|
|
||||||
<script defer src="{{this}}"></script>
|
|
||||||
{{/each}}
|
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user