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