overseer/src/routes/home.js

17 lines
282 B
JavaScript
Raw Normal View History

2022-11-02 13:45:40 -04:00
const db = require('../models');
const Item = db.items;
2022-11-01 23:55:07 -04:00
// GET - /
2022-11-03 22:28:01 -04:00
exports.getIndex = async function(req, res) {
const items = await Item.findAll({
limit: 10,
order: [
['updatedAt', 'DESC'],
2022-11-03 22:28:01 -04:00
],
});
res.render('index.twig', {
inventory: items,
});
2022-11-01 23:55:07 -04:00
};