Embellish home page

This commit is contained in:
2020-12-21 21:22:27 -08:00
parent 5cd5eac2c8
commit c0a69678db
+8 -1
View File
@@ -1,7 +1,14 @@
const { send, json } = require('micro')
const Database = require('better-sqlite3')
const page = require('../page')
const ds = require('../index')
const db = new Database('./main.db')
module.exports.GET = async (req, res) => {
const out = await page.render('index', {})
const years = await ds.getYears()
const categories = await ds.getCategories(db)
const tags = await ds.getTagCloud(db, 50)
const out = await page.render('index', { years, categories, tags })
send(res, 200, out)
}