From 75259def4c50ca5b1f51e10e8b7026dbe5c30275 Mon Sep 17 00:00:00 2001 From: Amp Date: Tue, 25 Aug 2026 18:44:25 +0000 Subject: [PATCH] feat: add AntelopeJS Co-authored-by: Upd4ting --- benchmarks/antelopejs.mjs | 35 +++++++++++++++++++++++++++++++++++ lib/packages.js | 1 + package.json | 1 + 3 files changed, 37 insertions(+) create mode 100644 benchmarks/antelopejs.mjs diff --git a/benchmarks/antelopejs.mjs b/benchmarks/antelopejs.mjs new file mode 100644 index 00000000..f687ce9d --- /dev/null +++ b/benchmarks/antelopejs.mjs @@ -0,0 +1,35 @@ +import { construct, start } from '@antelopejs/api' +import { Controller, Get, HTTPResult, Listen } from '@antelopejs/interface-api' +import { ImplementInterface } from '@antelopejs/interface-core' +import { createRequire } from 'node:module' + +const require = createRequire(import.meta.url) +const Runtime = require('@antelopejs/interface-core/runtime') + +ImplementInterface(Runtime, { + GetRuntimeInfo: () => ({ dev: false, projectPath: process.cwd(), env: 'benchmark' }), + RegisterDevServer: () => {} +}) + +class BenchmarkController extends Controller('/') { + index () { + return new HTTPResult( + 200, + { hello: 'world' }, + 'application/json; charset=utf-8' + ) + } +} + +Get('')( + BenchmarkController.prototype, + 'index', + Object.getOwnPropertyDescriptor(BenchmarkController.prototype, 'index') +) + +await construct({ + servers: [{ protocol: 'http', host: '::', port: 3000 }], + strictPort: true +}) +start() +await Listen() diff --git a/lib/packages.js b/lib/packages.js index 88c385a0..97f5ed64 100755 --- a/lib/packages.js +++ b/lib/packages.js @@ -7,6 +7,7 @@ const require = createRequire(import.meta.url); const packages = { '0http': { hasRouter: true, package: '0http' }, 'adonisjs': { hasRouter: true, package: '@adonisjs/http-server' }, + antelopejs: { hasRouter: true, package: '@antelopejs/api' }, connect: {}, 'connect-router': { extra: true, package: 'router', hasRouter: true }, elysia: { hasRouter: true }, diff --git a/package.json b/package.json index 80e8507b..79aed34e 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@adonisjs/events": "^10.2.0", "@adonisjs/http-server": "^9.1.0", "@adonisjs/logger": "^7.1.1", + "@antelopejs/api": "^1.2.4", "@elysia/node": "^1.4.5", "@hapi/hapi": "^21.1.0", "@hono/node-server": "^2.0.1",