[llvm] Add server API (PR #160307)
Ivan Kosarev via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 07:23:53 PDT 2025
https://github.com/kosarev updated https://github.com/llvm/llvm-project/pull/160307
>From 40c7a427a468c7ade4c7615ef2ab1bdaefd77240 Mon Sep 17 00:00:00 2001
From: Ivan Kosarev <ivan.kosarev at amd.com>
Date: Tue, 23 Sep 2025 15:14:57 +0100
Subject: [PATCH] Add server API
---
.../lib/Target/AMDGPU/graphite-demo/server.js | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 llvm/lib/Target/AMDGPU/graphite-demo/server.js
diff --git a/llvm/lib/Target/AMDGPU/graphite-demo/server.js b/llvm/lib/Target/AMDGPU/graphite-demo/server.js
new file mode 100644
index 0000000000000..cf7ec6507287f
--- /dev/null
+++ b/llvm/lib/Target/AMDGPU/graphite-demo/server.js
@@ -0,0 +1,36 @@
+const express = require('express');
+const app = express();
+const port = 3000;
+
+// Fake data for tasks
+const tasks = [
+ {
+ id: 1,
+ description: 'Complete monthly financial report'
+ },
+ {
+ id: 2,
+ description: 'Plan team building activity'
+ },
+ {
+ id: 3,
+ description: 'Update project documentation'
+ }
+];
+
+app.get('/search', (req, res) => {
+ // Retrieve the query parameter
+ const query = req.query.query?.toLowerCase() || '';
+
+ // Filter tasks based on the query
+ const filteredTasks = tasks.filter(task => task.description.toLowerCase().includes(query));
+
+ // Sort the filtered tasks alphabetically by description
+ const sortedTasks = filteredTasks.sort((a, b) => a.description.localeCompare(b.description));
+
+ res.json(sortedTasks);
+});
+
+app.listen(port, () => {
+ console.log(`Server running on port ${port}`);
+});
\ No newline at end of file
More information about the llvm-commits
mailing list