mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-08-04 01:42:00 +00:00
feat: added bg_color options, added RepoCard color options too
This commit is contained in:
18
api/pin.js
18
api/pin.js
@@ -4,7 +4,14 @@ const fetchRepo = require("../src/fetchRepo");
|
||||
const renderRepoCard = require("../src/renderRepoCard");
|
||||
|
||||
module.exports = async (req, res) => {
|
||||
const { username, repo } = req.query;
|
||||
const {
|
||||
username,
|
||||
repo,
|
||||
title_color,
|
||||
icon_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
} = req.query;
|
||||
|
||||
let repoData;
|
||||
res.setHeader("Content-Type", "image/svg+xml");
|
||||
@@ -16,5 +23,12 @@ module.exports = async (req, res) => {
|
||||
return res.send(renderError(err.message));
|
||||
}
|
||||
|
||||
res.send(renderRepoCard(repoData));
|
||||
res.send(
|
||||
renderRepoCard(repoData, {
|
||||
title_color,
|
||||
icon_color,
|
||||
text_color,
|
||||
bg_color,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user