Skip to content

Commit

Permalink
fix(platform): use slash in event handler for apiPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Apr 10, 2023
1 parent 2d77c7d commit 0b4c962
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/platform/src/lib/runtime/api-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { eventHandler } from 'h3';

export default eventHandler(async (event) => {
const apiPrefix = import.meta.env.RUNTIME_CONFIG?.apiPrefix ?? '/api';
const apiPrefix = `/${import.meta.env.RUNTIME_CONFIG?.apiPrefix ?? 'api'}`;
if (event.req.url?.startsWith(apiPrefix)) {
return $fetch(`${event.req.url?.replace(apiPrefix, '')}`);
}
Expand Down

0 comments on commit 0b4c962

Please sign in to comment.