Browse Source

Merge pull request #9597 from aaveshdev/master

Add Aroma.js to benchmarks
Mike Smith 5 months ago
parent
commit
0032e17d82

+ 27 - 0
frameworks/JavaScript/aroma.js/README.md

@@ -0,0 +1,27 @@
+# Aroma.js Benchmarking Test
+
+From [aroma.js.org](https://aroma.js.org):
+
+> Aroma.js is a lightweight, feature-rich, and developer-friendly web framework designed to build modern web applications with ease. It provides essential features like routing, middleware, session management, cookie handling, template rendering, static file serving, and more. With its simple API, it enables rapid development of web applications with flexibility.
+
+### Test Type Implementation Source Code
+
+- [JSON](app.js)
+- [PLAINTEXT](app.js)
+
+## Important Libraries
+
+The tests were run with:
+
+- [Aroma.js](https://aroma.js.org/)
+- [NodeJS](https://nodejs.org/en/)
+
+## Test URLs
+
+### JSON
+
+http://localhost:8080/json
+
+### PLAINTEXT
+
+http://localhost:8080/plaintext

+ 36 - 0
frameworks/JavaScript/aroma.js/app.js

@@ -0,0 +1,36 @@
+
+const cluster = require('cluster'),
+  numCPUs = require('os').cpus().length,
+  Aroma = require('aroma.js');
+
+
+if (cluster.isPrimary) {
+  console.log(`Primary ${process.pid} is running`);
+
+  for (let i = 0; i < numCPUs; i++) {
+    cluster.fork();
+  }
+
+  cluster.on('exit', (worker, code, signal) => {
+    console.log(`worker ${worker.process.pid} died`);
+  });
+} else {
+  const app = module.exports = new Aroma();
+
+  app.parseUrlEncoded();
+
+   app.use((req, res, next) => {
+    res.setHeader("Server", "Aroma.js");
+    return next();
+  });
+
+  app.get('/json', (req, res) => res.send({ message: 'Hello, World!' }));
+
+  app.get('/plaintext', (req, res) => {
+    res.setHeader('Content-Type', 'text/plain');
+    res.send('Hello, World!');
+  });
+  
+
+  app.listen(8080);
+}

+ 11 - 0
frameworks/JavaScript/aroma.js/aroma.js.dockerfile

@@ -0,0 +1,11 @@
+FROM node:20.16-slim
+
+COPY ./ ./
+
+RUN npm install
+
+ENV NODE_ENV production
+
+EXPOSE 8080
+
+CMD ["node", "app.js"]

+ 21 - 0
frameworks/JavaScript/aroma.js/benchmark_config.json

@@ -0,0 +1,21 @@
+{
+    "framework": "aroma.js",
+    "tests": [{
+      "default": {
+        "json_url": "/json",
+        "plaintext_url": "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "framework": "aroma.js",
+        "language": "JavaScript",
+        "flavor": "NodeJS",
+        "platform": "nodejs",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "aroma.js",
+        "versus": "nodejs"
+      }
+    }]
+  }

+ 13 - 0
frameworks/JavaScript/aroma.js/config.toml

@@ -0,0 +1,13 @@
+[framework]
+name = "aroma.js"
+
+[main]
+urls.plaintext = "/plaintext"
+urls.json = "/json"
+approach = "Realistic"
+classification = "Micro"
+database_os = "Linux"
+os = "Linux"
+platform = "nodejs"
+webserver = "None"
+versus = "nodejs"

+ 8 - 0
frameworks/JavaScript/aroma.js/package.json

@@ -0,0 +1,8 @@
+{
+    "name": "aroma.js",
+    "dependencies": {
+      "aroma.js": "1.0.8"
+    },
+    "main": "app.js"
+  }
+