diff --git a/frameworks/JavaScript/aroma.js/README.md b/frameworks/JavaScript/aroma.js/README.md new file mode 100644 index 00000000000..927f8006851 --- /dev/null +++ b/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 diff --git a/frameworks/JavaScript/aroma.js/app.js b/frameworks/JavaScript/aroma.js/app.js new file mode 100644 index 00000000000..414af881bfa --- /dev/null +++ b/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); +} diff --git a/frameworks/JavaScript/aroma.js/aroma.js.dockerfile b/frameworks/JavaScript/aroma.js/aroma.js.dockerfile new file mode 100644 index 00000000000..ec726dd2800 --- /dev/null +++ b/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"] diff --git a/frameworks/JavaScript/aroma.js/benchmark_config.json b/frameworks/JavaScript/aroma.js/benchmark_config.json new file mode 100644 index 00000000000..5d5a3fdaa62 --- /dev/null +++ b/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" + } + }] + } \ No newline at end of file diff --git a/frameworks/JavaScript/aroma.js/config.toml b/frameworks/JavaScript/aroma.js/config.toml new file mode 100644 index 00000000000..b7c4320a60c --- /dev/null +++ b/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" diff --git a/frameworks/JavaScript/aroma.js/package.json b/frameworks/JavaScript/aroma.js/package.json new file mode 100644 index 00000000000..4f9d2856a44 --- /dev/null +++ b/frameworks/JavaScript/aroma.js/package.json @@ -0,0 +1,8 @@ +{ + "name": "aroma.js", + "dependencies": { + "aroma.js": "1.0.8" + }, + "main": "app.js" + } + \ No newline at end of file