Skip to content

Commit 0032e17

Browse files
Merge pull request #9597 from aaveshdev/master
Add Aroma.js to benchmarks
2 parents aa00028 + b51bf54 commit 0032e17

File tree

6 files changed

+116
-0
lines changed

6 files changed

+116
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Aroma.js Benchmarking Test
2+
3+
From [aroma.js.org](https://aroma.js.org):
4+
5+
> 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.
6+
7+
### Test Type Implementation Source Code
8+
9+
- [JSON](app.js)
10+
- [PLAINTEXT](app.js)
11+
12+
## Important Libraries
13+
14+
The tests were run with:
15+
16+
- [Aroma.js](https://aroma.js.org/)
17+
- [NodeJS](https://nodejs.org/en/)
18+
19+
## Test URLs
20+
21+
### JSON
22+
23+
http://localhost:8080/json
24+
25+
### PLAINTEXT
26+
27+
http://localhost:8080/plaintext

frameworks/JavaScript/aroma.js/app.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
const cluster = require('cluster'),
3+
numCPUs = require('os').cpus().length,
4+
Aroma = require('aroma.js');
5+
6+
7+
if (cluster.isPrimary) {
8+
console.log(`Primary ${process.pid} is running`);
9+
10+
for (let i = 0; i < numCPUs; i++) {
11+
cluster.fork();
12+
}
13+
14+
cluster.on('exit', (worker, code, signal) => {
15+
console.log(`worker ${worker.process.pid} died`);
16+
});
17+
} else {
18+
const app = module.exports = new Aroma();
19+
20+
app.parseUrlEncoded();
21+
22+
app.use((req, res, next) => {
23+
res.setHeader("Server", "Aroma.js");
24+
return next();
25+
});
26+
27+
app.get('/json', (req, res) => res.send({ message: 'Hello, World!' }));
28+
29+
app.get('/plaintext', (req, res) => {
30+
res.setHeader('Content-Type', 'text/plain');
31+
res.send('Hello, World!');
32+
});
33+
34+
35+
app.listen(8080);
36+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:20.16-slim
2+
3+
COPY ./ ./
4+
5+
RUN npm install
6+
7+
ENV NODE_ENV production
8+
9+
EXPOSE 8080
10+
11+
CMD ["node", "app.js"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"framework": "aroma.js",
3+
"tests": [{
4+
"default": {
5+
"json_url": "/json",
6+
"plaintext_url": "/plaintext",
7+
"port": 8080,
8+
"approach": "Realistic",
9+
"classification": "Micro",
10+
"framework": "aroma.js",
11+
"language": "JavaScript",
12+
"flavor": "NodeJS",
13+
"platform": "nodejs",
14+
"webserver": "None",
15+
"os": "Linux",
16+
"database_os": "Linux",
17+
"display_name": "aroma.js",
18+
"versus": "nodejs"
19+
}
20+
}]
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[framework]
2+
name = "aroma.js"
3+
4+
[main]
5+
urls.plaintext = "/plaintext"
6+
urls.json = "/json"
7+
approach = "Realistic"
8+
classification = "Micro"
9+
database_os = "Linux"
10+
os = "Linux"
11+
platform = "nodejs"
12+
webserver = "None"
13+
versus = "nodejs"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "aroma.js",
3+
"dependencies": {
4+
"aroma.js": "1.0.8"
5+
},
6+
"main": "app.js"
7+
}
8+

0 commit comments

Comments
 (0)