Comparing version 0.2.2 to 0.2.3
@@ -38,3 +38,2 @@ import { Raikiri } from 'raikiri'; | ||
this.config = { | ||
strictPath: false, | ||
...config | ||
@@ -85,7 +84,2 @@ }; | ||
this.router.add(method, path, mainHandler); | ||
if (!this.config.strictPath && path !== '/') | ||
if (path.endsWith('/')) | ||
this.router.add(method, path.substring(0, path.length - 1), mainHandler); | ||
else | ||
this.router.add(method, `${path}/`, mainHandler); | ||
} | ||
@@ -163,3 +157,6 @@ onStart(handler) { | ||
Object.values(instance.routes).forEach(({ method, path, handler, hooks }) => { | ||
this._addHandler(method, `${prefix}${path}`, handler, hooks); | ||
if (path === '/') | ||
this._addHandler(method, prefix, handler, hooks); | ||
else | ||
this._addHandler(method, `${prefix}${path}`, handler, hooks); | ||
}); | ||
@@ -166,0 +163,0 @@ return this; |
@@ -175,3 +175,2 @@ /// <reference types="bun-types" /> | ||
export interface ElysiaConfig { | ||
strictPath: boolean; | ||
serve?: Partial<Serve>; | ||
@@ -178,0 +177,0 @@ } |
{ | ||
"name": "elysia", | ||
"description": "Fast, and friendly Bun web framework", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"author": { | ||
@@ -40,3 +40,3 @@ "name": "saltyAom", | ||
"openapi-types": "^12.1.0", | ||
"raikiri": "0.0.0-beta.3" | ||
"raikiri": "0.0.0-beta.4" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2
64071
1284
+ Addedraikiri@0.0.0-beta.4(transitive)
- Removedraikiri@0.0.0-beta.3(transitive)
Updatedraikiri@0.0.0-beta.4