Spaces:
Runtime error
Runtime error
Commit ·
4b76377
1
Parent(s): 6968b8e
Update index.js
Browse files
index.js
CHANGED
|
@@ -252,6 +252,17 @@ app.post('/ask', async (req, res) => {
|
|
| 252 |
}
|
| 253 |
});
|
| 254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
const PORT = process.env.PORT || 7860;
|
| 256 |
|
| 257 |
app.listen(PORT, () => {
|
|
|
|
| 252 |
}
|
| 253 |
});
|
| 254 |
|
| 255 |
+
app.post('/ask1', async (req, res) => {
|
| 256 |
+
try {
|
| 257 |
+
const conversation = await claude.startConversation(req.body.message);
|
| 258 |
+
|
| 259 |
+
res.json(conversation);
|
| 260 |
+
} catch (err) {
|
| 261 |
+
res.status(500).send({ error: 'Failed to get response' });
|
| 262 |
+
}
|
| 263 |
+
});
|
| 264 |
+
|
| 265 |
+
|
| 266 |
const PORT = process.env.PORT || 7860;
|
| 267 |
|
| 268 |
app.listen(PORT, () => {
|