Embellish home page
This commit is contained in:
+8
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user