Skip to content

Commit

Permalink
fix(openapi): avoid double slash for base
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 15, 2024
1 parent f733032 commit fdf7e70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/routes/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import type {
ParameterObject,
PathsObject,
} from "openapi-typescript";
import { joinURL } from "ufo";
import { handlersMeta } from "#internal/nitro/virtual/server-handlers";
import { useRuntimeConfig } from "#internal/nitro";

// Served as /_nitro/openapi.json
export default eventHandler((event) => {
const base = useRuntimeConfig()?.app?.baseURL;

const url = getRequestURL(event).origin + base;
const url = joinURL(getRequestURL(event).origin, base);

return <OpenAPI3>{
openapi: "3.0.0",
Expand Down

0 comments on commit fdf7e70

Please sign in to comment.