Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AdonisJS #343

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions benchmarks/adonisjs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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 { Application } from '@adonisjs/application'

const app = new Application(new URL('./', import.meta.url), {
environment: 'web',

Check failure on line 9 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected tab character

Check failure on line 9 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Expected indentation of 2 spaces but found 1 tab
importer: () => {},

Check failure on line 10 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected tab character

Check failure on line 10 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Expected indentation of 2 spaces but found 1 tab

Check failure on line 10 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected trailing comma
})

await app.init()

const encryption = new Encryption({ secret: 'averylongrandom32charslongsecret' })

const server = new Server(
app,

Check failure on line 18 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected tab character

Check failure on line 18 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Expected indentation of 2 spaces but found 1 tab
encryption,

Check failure on line 19 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected tab character

Check failure on line 19 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Expected indentation of 2 spaces but found 1 tab
new Emitter(app),

Check failure on line 20 in benchmarks/adonisjs.mjs

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected tab character
new Logger({ enabled: false }),
defineConfig({})
)

server.getRouter().get('/', async (ctx) => {
return ctx.response.send({ hello: 'world' })
})

await server.boot()

createServer(server.handle.bind(server)).listen(3000)
1 change: 1 addition & 0 deletions lib/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import path from 'path';

const packages = {
'0http': { hasRouter: true, package: '0http' },
'adonisjs': { hasRouter: true, package: '@adonisjs/http-server' },
bare: { version: process.version },
connect: {},
'connect-router': { extra: true, package: 'router', hasRouter: true },
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
},
"license": "MIT",
"dependencies": {
"@adonisjs/application": "^8.3.1",
"@adonisjs/encryption": "^6.0.2",
"@adonisjs/events": "^9.0.2",
"@adonisjs/http-server": "^7.2.3",
"@adonisjs/logger": "^6.0.3",
"@hapi/hapi": "^21.1.0",
"@hono/node-server": "^1.3.0",
"@leizm/web": "^2.7.3",
Expand Down
Loading