url /api anpassung ans caddy
This commit is contained in:
parent
5196cb9811
commit
1c5f3ff16c
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user