瀏覽代碼

Add logging

Simply log search params to response code.
master
TheoryOfNekomata 4 年之前
父節點
當前提交
593106c791
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      index.js

+ 2
- 0
index.js 查看文件

@@ -20,6 +20,7 @@ const server = http.createServer(async (req, res) => {
const badgeUrl = await getBadgeUrl(searchParams)

if (badgeUrl === null) {
console.log(JSON.stringify(searchParams), 404)
res.writeHead(404, {})
res.write('No badge available.')
res.end()
@@ -33,6 +34,7 @@ const server = http.createServer(async (req, res) => {
})
res.writeHead(200, { 'content-type': 'image/svg+xml', })
response.data.on('finish', () => {
console.log(JSON.stringify(searchParams), 200)
res.end()
})
response.data.pipe(res)


Loading…
取消
儲存