Created
January 22, 2023 15:22
-
-
Save Prosen-Ghosh/33c79291fd7066daa6e6906d4786d609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Redis = require("ioredis"); | |
const redis = new Redis(); | |
app.post("/add-article", async (req, res) => { | |
const article = req.body; | |
await redis.zadd("articles", article.score, JSON.stringify(article)); | |
res.send("Article added!"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment