Explorar el Código

Add logging

Simply log search params to response code.
master
TheoryOfNekomata hace 3 años
padre
commit
593106c791
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. +2
    -0
      index.js

+ 2
- 0
index.js Ver fichero

@@ -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)


Cargando…
Cancelar
Guardar