Add sponsor price endpoint and fetch pricing from backend on frontend

Made-with: Cursor
This commit is contained in:
Michilis
2026-03-16 18:21:41 +00:00
parent a47868d17c
commit f43f0bc501
4 changed files with 44 additions and 13 deletions

View File

@@ -9,6 +9,11 @@ const router = Router();
const SNAP_DAYS = [1, 3, 7, 14, 30, 60, 90, 180, 365];
/** Public endpoint: returns base sponsor price per day for display. */
router.get("/price", (_req: Request, res: Response) => {
res.json({ baseSponsorPricePerDay: config.baseSponsorPricePerDay });
});
function snapDays(days: number): number {
let best = SNAP_DAYS[0];
for (const d of SNAP_DAYS) {