mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-04 08:41:49 +01:00
get convos endpoint
This commit is contained in:
parent
c821d1eee5
commit
2869638cc0
6 changed files with 50 additions and 5 deletions
|
|
@ -2,7 +2,7 @@ const express = require('express');
|
|||
const { ask, titleConversation } = require('../app/chatgpt');
|
||||
const dbConnect = require('../models/dbConnect');
|
||||
const { saveMessage } = require('../models/Message');
|
||||
const { saveConversation } = require('../models/Conversation');
|
||||
const { saveConversation, getConversations } = require('../models/Conversation');
|
||||
const crypto = require('crypto');
|
||||
const path = require('path');
|
||||
const cors = require('cors');
|
||||
|
|
@ -21,6 +21,10 @@ app.get('/', function (req, res) {
|
|||
res.sendFile(path.join(projectPath, 'public', 'index.html'));
|
||||
});
|
||||
|
||||
app.get('/convos', async (req, res) => {
|
||||
res.status(200).send(await getConversations());
|
||||
});
|
||||
|
||||
app.post('/ask', async (req, res) => {
|
||||
console.log(req.body);
|
||||
const { text, parentMessageId, conversationId } = req.body;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue