diff --git a/server.js b/server.js index 7e502c3..eb27eca 100644 --- a/server.js +++ b/server.js @@ -3,6 +3,7 @@ import bodyParser from 'body-parser'; import { similaritySearch } from './similarity-search.js'; import { sharePic } from './share-pic.js'; import { fetchRandomHighlight, fetchRandomHighlightInBookID } from './get-random-highlight.js'; +import { addThoughtToHighlight } from './add-thought-to-highlight.js'; const app = express(); @@ -37,6 +38,15 @@ app.post('/search', async (req, res) => { res.send(results) }) +app.post('/add-thought', async (req, res) => { + console.log(req.body) + const highlightId = req.body.highlightId + const thought = req.body.thought + const userId = req.body.userId + const result = await addThoughtToHighlight(highlightId, thought, userId) + res.send(result) +} + app.post('/share', async (req, res) => { // console.log(req.body) const url = req.body.url