url /api anpassung ans caddy

This commit is contained in:
Daniel Nagel 2025-09-24 10:30:39 +02:00
parent 5196cb9811
commit 1c5f3ff16c
2 changed files with 1 additions and 2 deletions

View File

@ -1,7 +1,6 @@
const Redis = require("ioredis");
var data; //Die Daten von Grist.
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
const GRIST_URL = process.env.GRIST_BASE_URL;
const API_KEY = process.env.GRIST_API_KEY;

View File

@ -25,7 +25,7 @@ http.createServer(async (req, res) => {
// -------------------------------------
if (req.method === "POST" && req.url === "/api/job") {
if (req.method === "POST" && req.url === "/job") {
const stream = await readJsonBody(req); // JSON Stream vom Client. mit readJsonBody() wieder zurück in JSON.
await redis.lpush(JOBS, JSON.stringify(stream)); // Job in Queue. Als String in Redis eintragen. Der Worker nimmt dann den String.
const reply = await redis.blpop(RESULTS, 30); // auf Antwort warten