mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-04 03:31:36 +00:00
First release
This commit is contained in:
parent
32e4f3d854
commit
6fd7cc501e
31 changed files with 2759 additions and 348 deletions
18
html/static/js/templates/api/templates.js
Normal file
18
html/static/js/templates/api/templates.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const passthrough = require("../../../../../passthrough")
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
route: "/api/templates", methods: ["GET"], code: async () => {
|
||||
const result = {}
|
||||
const entries = passthrough.instance.pugCache.entries()
|
||||
for (const [file, value] of entries) {
|
||||
const match = file.match(/client\/.*?([^/]+)\.pug$/)
|
||||
if (match) {
|
||||
const name = match[1]
|
||||
result[name] = value.client.toString()
|
||||
}
|
||||
}
|
||||
return [200, result]
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue