* tests: fix float problems and PAT problem * extend CONTRIBUTING.md * extend build documentation, add GH action, fix build on MacOS * fix build on Vercel * update .gitignore and CONTRIBUTING.md * feat: begin work on monorepo * chore(actions/basic-build): use pnpm * fix: vercel-deploy * docs: updates with new folders * chore: apply PR review comments --------- Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
19 lines
502 B
JavaScript
19 lines
502 B
JavaScript
import { fetchWakatimeStats } from "../src/fetchers/wakatime.js";
|
|
import { logger } from "../src/common/log.js";
|
|
|
|
/**
|
|
* @param {any} req The request.
|
|
* @param {any} res The response.
|
|
*/
|
|
export default async (req, res) => {
|
|
const { username } = req.query;
|
|
res.setHeader("Content-Type", "application/json");
|
|
try {
|
|
const stats = await fetchWakatimeStats({ username });
|
|
res.send(stats);
|
|
} catch (err) {
|
|
logger.error(err);
|
|
res.send("Something went wrong: " + err.message);
|
|
}
|
|
};
|