aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/index.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/api/index.ts b/api/index.ts
index 9435bb1..a2a1378 100644
--- a/api/index.ts
+++ b/api/index.ts
@@ -25,6 +25,16 @@ app.get('/attachments/:slug', (req, res) => {
}
});
+app.get('/reactions/:slug', (req, res) => {
+ if (req.params.slug) {
+ const query = db.prepare(`SELECT * FROM announcements_reactions WHERE msg_id = (?)`);
+ const result = query.all(req.params.slug);
+ res.send(result);
+ } else {
+ res.send('Unknown message id.');
+ }
+});
+
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});