mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2025-06-27 23:58:22 +00:00

subrepo: subdir: "src/site/html/static/js/templates" merged: "a768add" upstream: origin: "/home/cloud/Code/pinski-plugins/templates" branch: "master" commit: "a768add" git-subrepo: version: "0.4.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "5d6aba9"
19 lines
457 B
JavaScript
19 lines
457 B
JavaScript
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]
|
|
}
|
|
}
|
|
]
|