change script for list

This commit is contained in:
Nikola Petrov 2023-09-01 22:53:38 +02:00
parent 43ea7f5308
commit b2fb9ea911
2 changed files with 2 additions and 17 deletions

View File

@ -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;

View File

@ -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">