We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4360837 commit 96efe13Copy full SHA for 96efe13
1 file changed
graphite-demo/server.js
@@ -0,0 +1,33 @@
1
+const express = require('express');
2
+const app = express();
3
+const port = 3000;
4
+
5
+// Fake data for tasks
6
+const tasks = [
7
+ {
8
+ id: 1,
9
+ description: 'Complete monthly financial report'
10
+ },
11
12
+ id: 2,
13
+ description: 'Plan team building activity'
14
15
16
+ id: 3,
17
+ description: 'Update project documentation'
18
+ }
19
+];
20
21
+app.get('/search', (req, res) => {
22
+ // Retrieve the query parameter
23
+ const query = req.query.query?.toLowerCase() || '';
24
25
+ // Filter tasks based on the query
26
+ const filteredTasks = tasks.filter(task => task.description.toLowerCase().includes(query));
27
28
+ res.json(filteredTasks);
29
+});
30
31
+app.listen(port, () => {
32
+ console.log(`Server running on port ${port}`);
33
0 commit comments