From f9aa5a651dcdcfbde70683642a8a58478202d4e6 Mon Sep 17 00:00:00 2001 From: aquapi Date: Thu, 16 May 2024 14:34:53 +0700 Subject: [PATCH] Update Blitz --- README.md | 2 +- package.json | 4 ++-- src/core/server/index.ts | 2 +- src/core/server/route.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 36774c2..a850659 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Byte starts up faster than the `hono/quick` preset with LinearRouter. [687.44ms] Hono: Build 1000 routes ``` -Byte matches routes 7x faster than Hono with RegExpRouter. +Byte matches routes 6x faster than Hono with RegExpRouter. ``` "/user": - Hono: 23416ns diff --git a/package.json b/package.json index 20e5756..0e257fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bit-js/byte", - "version": "1.3.0", + "version": "1.3.1", "module": "index.js", "devDependencies": { "@types/bun": "latest", @@ -9,7 +9,7 @@ "type": "module", "types": "types/index.d.ts", "dependencies": { - "@bit-js/blitz": "^1.2.5" + "@bit-js/blitz": "^1.3.0" }, "scripts": { "build-test": "bun build.ts && bun test && tsc --noEmit -p ./tests/tsconfig.json" diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 9f0dae0..ecd9537 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -70,7 +70,7 @@ export class Byte implements ProtoSchema { readonly routes: BaseRoute[] = []; /** - * Register subroutes + * Register sub-routes */ route(base: string, { routes, actions }: BaseByte) { const currentRoutes = this.routes; diff --git a/src/core/server/route.ts b/src/core/server/route.ts index 1b77b08..05c044b 100644 --- a/src/core/server/route.ts +++ b/src/core/server/route.ts @@ -49,7 +49,7 @@ export class Route< if (this.method === null) router.handle(this.path, this.compile()); else - router.put(this.method, this.path, this.compile()); + router.on(this.method, this.path, this.compile()); } /**