Files
github-stats-extended/api-renamed/repeat-recent.js
T
2025-06-26 14:11:24 +00:00

19 lines
543 B
JavaScript

import { repeatRecentRequests } from "../src/common/database.js";
export default async (req, res) => {
if (req.method !== "POST") {
res.statusCode = 405;
res.send({ error: "Method Not Allowed" });
return;
}
try {
await repeatRecentRequests();
res.statusCode = 200;
res.send({ message: "Recent requests repeated successfully." });
} catch (error) {
console.error("Error repeating recent requests:", error);
res.statusCode = 500;
res.send({ error: error.message || "Internal Server Error" });
}
};