Skip to content

Commit

Permalink
Fix openapi not taking into consideration base url (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
G4brym authored Dec 7, 2022
2 parents 1c35176 + 10fd688 commit 3c411a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflare/itty-router-openapi",
"version": "0.0.11",
"version": "0.0.12",
"description": "OpenAPI schema generator and validator for Cloudflare Workers",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function OpenAPIRouter(options?: RouterOptions): OpenAPIRouterSchema {
return (route: string, ...handlers: any) => {
if (prop !== 'handle') {
if (prop !== 'all') {
const parsedRoute = route.replace(/:(\w+)/g, '{$1}')
const parsedRoute = (options?.base || '') + route.replace(/:(\w+)/g, '{$1}')

let schema: OpenAPISchema = undefined
let operationId: string = undefined
Expand Down

0 comments on commit 3c411a0

Please sign in to comment.