diff --git a/.env.example b/.env.example index 38cebe6..c4b12c8 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ EMAIL_FROM="noreply@lauf-fuer-kaya.de" EMAIL_REPLYTO="info@lauf-fuer-kaya.de" REDIS_URL=redis://localhost:6379 FRONTEND_URL="https://run.lauf-fuer-kaya.de" +DOCUMENT_SERVER_URL="https://documents.run.lauf-fuer-kaya.de/" AUTHKEY="" EVENT_DATE="23.05.2025" EVENT_NAME="Lauf für Kaya! 2025" \ No newline at end of file diff --git a/bun.lockb b/bun.lockb old mode 100644 new mode 100755 index 22a33a5..2888829 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 0c40202..2ebbdc3 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "@hono/zod-openapi": "0.18.3", "@hono/zod-validator": "0.4.1", "bullmq": "5.34.0", - "bwip-js": "4.5.1", "handlebars": "4.7.8", "hono": "4.6.13", "ioredis": "5.4.1", diff --git a/src/routes/email.ts b/src/routes/email.ts index d063d9c..cc190f5 100644 --- a/src/routes/email.ts +++ b/src/routes/email.ts @@ -5,7 +5,6 @@ import { z } from 'zod' import { EmailService } from '../services/email' import { getEmailTemplate } from '../templates' import { Language } from '../types' -import { toBuffer } from 'bwip-js/node' const emailRouter = new Hono() const emailService = new EmailService() @@ -18,20 +17,7 @@ const sendEmailSchema = z.object({ }) async function generateBarcodeDataURL(data) { - return `https://barcodeapi.org/api/128/${data}` - const buffer = await toBuffer({ - bcid: 'code128', - text: data, - scale: 3, - height: 10, - includetext: true, - textxalign: 'center', - }); - - const base64Data = buffer.toString('base64'); - const dataURL = `data:image/png;base64,${base64Data}`; - - return dataURL; + return `${process.env.DOCUMENT_SERVER_URL}/v1/barcodes/code128/${data}` } emailRouter.post('/', bearerAuth({ token: process.env.AUTHKEY }), zValidator('json', sendEmailSchema), async (c) => {