diff --git a/index.js b/index.js index 9ba89b4..20e663c 100644 --- a/index.js +++ b/index.js @@ -42,12 +42,10 @@ void (async () => { res.json({ success: true }) }) - app.post("/chat", async (req, res) => { + app.post("/chat", urlencoded({ "extended": true }), async (req, res) => { try { - const output = await chat(req.body.prompt, redisClient) - res.json({ - response: output - }) + const output = await chat(req.body.text, redisClient) + res.send(output) } catch(err) { console.log("Error in /chat", err) res.status(500).send(err) diff --git a/public/index.html b/public/index.html index 7297a5d..c1af42c 100644 --- a/public/index.html +++ b/public/index.html @@ -44,6 +44,10 @@ width: 100%; } +input[type="submit"]:disabled { + background-color: #888; +} + button:hover { background-color: #444; } @@ -83,7 +87,8 @@