Files
github-stats-extended/api-renamed/repeat-recent.js
T
2025-09-02 11:27:21 +02:00

19 lines
542 B
JavaScript

import { repeatRecentRequests } from "../src/repeatRequests.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" });
}
};