15 lines
426 B
JavaScript
15 lines
426 B
JavaScript
const { send, json } = require('micro')
|
|
const Database = require('better-sqlite3')
|
|
|
|
const page = require('../page')
|
|
const ds = require('../index')
|
|
const db = ds.db()
|
|
|
|
module.exports.GET = async (req, res) => {
|
|
const years = await ds.getYears()
|
|
const categories = await ds.getCategories(db)
|
|
const tags = require('../top-tags')
|
|
const out = await page.render('index', { years, categories, tags })
|
|
send(res, 200, out)
|
|
}
|