Skip to content

Instantly share code, notes, and snippets.

@Prosen-Ghosh
Created January 22, 2023 15:22
Show Gist options
  • Save Prosen-Ghosh/33c79291fd7066daa6e6906d4786d609 to your computer and use it in GitHub Desktop.
Save Prosen-Ghosh/33c79291fd7066daa6e6906d4786d609 to your computer and use it in GitHub Desktop.
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