feat: spin the wheel, objednavani scrape menu, historie cen
CI / Generate TypeScript types (push) Successful in 11s
CI / Server unit tests (push) Successful in 25s
CI / Build server (push) Successful in 29s
CI / Build client (push) Successful in 39s
CI / Playwright E2E tests (push) Successful in 1m52s
CI / Build and push Docker image (push) Successful in 51s
CI / Notify (push) Successful in 2s
CI / Generate TypeScript types (push) Successful in 11s
CI / Server unit tests (push) Successful in 25s
CI / Build server (push) Successful in 29s
CI / Build client (push) Successful in 39s
CI / Playwright E2E tests (push) Successful in 1m52s
CI / Build and push Docker image (push) Successful in 51s
CI / Notify (push) Successful in 2s
This commit is contained in:
35 files changed
+3979
-15
No files matched your search
@@ -29,6 +29,7 @@ import changelogRoutes from "./routes/changelogRoutes";
|
||||
import groupRoutes from "./routes/groupRoutes";
|
||||
import storeRoutes from "./routes/storeRoutes";
|
||||
import butterflyRoutes from "./routes/butterflyRoutes";
|
||||
import { getConfettiCharacters, getConfettiImage } from "./confetti";
|
||||
|
||||
const ENVIRONMENT = process.env.NODE_ENV ?? 'production';
|
||||
dotenv.config({ path: path.resolve(__dirname, `../.env.${ENVIRONMENT}`) });
|
||||
@@ -200,6 +201,25 @@ app.post("/api/notifications/push/quickChoice", async (req, res, next) => {
|
||||
} catch (e: any) { next(e); }
|
||||
});
|
||||
|
||||
// Konfety kola štěstí — veřejné (načítá je <img>), obrázky jen z pevného seznamu, cachované ve storage
|
||||
app.get("/api/confetti/umamusume", (_req, res) => {
|
||||
// Seznam je malý — vždy revalidovat (ETag → 304), aby se změny projevily hned po nasazení
|
||||
res.set('Cache-Control', 'no-cache').json(getConfettiCharacters());
|
||||
});
|
||||
|
||||
app.get("/api/confetti/image/:id", async (req, res, next) => {
|
||||
try {
|
||||
const id = req.params.id;
|
||||
const image = /^[0-9a-f]{16}$/.test(id) ? await getConfettiImage(id) : undefined;
|
||||
if (!image) {
|
||||
return res.status(404).json({ error: 'Obrázek není dostupný' });
|
||||
}
|
||||
res.set('Content-Type', image.contentType);
|
||||
res.set('Cache-Control', 'public, max-age=2592000, immutable');
|
||||
res.end(image.data);
|
||||
} catch (e: any) { next(e); }
|
||||
});
|
||||
|
||||
// ─── Auth middleware ──────────────────────────────────────────────────────────
|
||||
|
||||
app.use("/api/", (req, res, next) => {
|
||||
|
||||
Reference in new issue
Block a user