diff --git a/benchmarks/adonisjs.mjs b/benchmarks/adonisjs.mjs index c7a6a479..439b4f42 100644 --- a/benchmarks/adonisjs.mjs +++ b/benchmarks/adonisjs.mjs @@ -2,7 +2,8 @@ import { createServer } from 'node:http' import { defineConfig, Server } from '@adonisjs/http-server' import { Logger } from '@adonisjs/logger' import { Emitter } from '@adonisjs/events' -import { Encryption } from '@adonisjs/encryption' +import { Encryption } from '@boringnode/encryption' +import { chacha20poly1305 } from '@boringnode/encryption/drivers/chacha20_poly1305' import { Application } from '@adonisjs/application' const app = new Application(new URL('./', import.meta.url), { @@ -12,14 +13,21 @@ const app = new Application(new URL('./', import.meta.url), { await app.init() -const encryption = new Encryption({ secret: 'averylongrandom32charslongsecret' }) +const encryption = new Encryption( + chacha20poly1305({ id: 'app', keys: ['averylongrandom32charslongsecret'] }) +) const server = new Server( app, encryption, new Emitter(app), new Logger({ enabled: false }), - defineConfig({}) + defineConfig({ + router: { matcher: 'tree' }, + serializeJSON (v) { + return JSON.stringify(v) + } + }) ) server.getRouter().get('/', (ctx) => { diff --git a/package.json b/package.json index f1ef2681..47211b08 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,11 @@ }, "license": "MIT", "dependencies": { - "@adonisjs/application": "^9.0.1", - "@adonisjs/encryption": "^6.0.2", + "@adonisjs/application": "^9.1.0", "@adonisjs/events": "^10.2.0", - "@adonisjs/http-server": "^9.1.0", + "@adonisjs/http-server": "^9.3.1", "@adonisjs/logger": "^7.1.1", + "@boringnode/encryption": "^1.0.1", "@elysia/node": "^1.4.5", "@hapi/hapi": "^21.1.0", "@hono/node-server": "^2.0.1",