diff --git a/benchmarks/fulmine.cjs b/benchmarks/fulmine.cjs new file mode 100644 index 00000000..c5d5ece0 --- /dev/null +++ b/benchmarks/fulmine.cjs @@ -0,0 +1,16 @@ +'use strict' + +const http = require('node:http') +const fulmine = require('fulmine.js') + +const app = fulmine() + +app.disable('etag') +app.disable('x-powered-by') + +app.get('/', function (_req, res) { + res.json({ hello: 'world' }) +}) + +// through node:http, as the rules ask: app.listen() would serve it with µWS +http.createServer(app).listen(3000) diff --git a/lib/no-uws/index.js b/lib/no-uws/index.js new file mode 100644 index 00000000..b12e89d6 --- /dev/null +++ b/lib/no-uws/index.js @@ -0,0 +1,5 @@ +'use strict' + +// Put in place of uWebSockets.js by the override in package.json: fulmine.js runs here through node:http, +// so it never loads uWebSockets.js, and if it did the server would not start +throw new Error('uWebSockets.js is not installed in this benchmark, fulmine.js runs through node:http') diff --git a/lib/no-uws/package.json b/lib/no-uws/package.json new file mode 100644 index 00000000..cb19b0e0 --- /dev/null +++ b/lib/no-uws/package.json @@ -0,0 +1,6 @@ +{ + "name": "uWebSockets.js", + "version": "0.0.0", + "private": true, + "main": "index.js" +} diff --git a/lib/packages.js b/lib/packages.js index 88c385a0..9d2d96ab 100755 --- a/lib/packages.js +++ b/lib/packages.js @@ -14,6 +14,7 @@ const packages = { 'express-with-middlewares': { extra: true, package: 'express', hasRouter: true }, fastify: { checked: true, hasRouter: true }, 'fastify-big-json': { extra: true, package: 'fastify', hasRouter: true }, + fulmine: { hasRouter: true, package: 'fulmine.js' }, h3: { package: 'h3', hasRouter: true }, hapi: { hasRouter: true, package: '@hapi/hapi' }, hono: { hasRouter: true, package: 'hono' }, diff --git a/package.json b/package.json index 6e1b9a32..780490ea 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "express": "^5.2.1", "fastify": "^5.0.0", "frameguard": "^4.0.0", + "fulmine.js": "^5.21.5", "h3": "2.0.1-rc.32", "hide-powered-by": "^1.1.0", "hono": "^4.0.1", @@ -77,6 +78,9 @@ "srvx": "^0.12.1", "x-xss-protection": "^2.0.0" }, + "overrides": { + "uWebSockets.js": "file:./lib/no-uws" + }, "devDependencies": { "snazzy": "^9.0.0", "standard": "^17.0.0"