This commit is contained in:
Rohit Sah 2023-04-04 12:35:56 -07:00 committed by GitHub
commit 59d5969602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -58,6 +58,28 @@ app.get('/record/@:name', async (req, res) => {
res.json(data)
})
app.get('/number/@:num', async (req, res) => {
const { num } = req.params
console.log(num)
const { theme = 'moebooru' } = req.query
let length = PLACES
// This helps with GitHub's image cache
res.set({
'content-type': 'image/svg+xml',
'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',
})
length = 10
// Send the generated SVG as the result
const renderSvg = themify.getCountImage({
count: parseInt(num),
theme,
length,
})
res.send(renderSvg)
})
app.get('/heart-beat', (req, res) => {
res.set({
'cache-control': 'max-age=0, no-cache, no-store, must-revalidate'

View File

@ -27,12 +27,18 @@ html
h5 SVG address
code #{site}/get/@:name
code https://count.getloli.com/number/@:num
h5 Img tag
code <img src="#{site}/get/@:name" alt=":name" />
code <img src="https://count.getloli.com/number/@:num" alt=":name" />
h5 Markdown
code ![:name](#{site}/get/@:name)
code ![:name](https://count.getloli.com/number/@:num)
h3 eg:
<img src="#{site}/get/@index" alt="Moe Count!" />