Skip to content

Commit

Permalink
feat: allow leaving api port blank
Browse files Browse the repository at this point in the history
  • Loading branch information
josselinonduty committed Feb 4, 2025
1 parent 19149a2 commit f18c179
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion composables/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function useApi() {
const api = useRuntimeConfig().public.api;
const baseUrl = `${api.host}:${api.port}/api`;
const baseUrl = `${api.host}${api.port ? ":" + api.port : ""}/api`;

function createHttpEndpoint(path: string) {
return `${api.secure ? "https" : "http"}://${baseUrl}${path}`;
Expand Down

0 comments on commit f18c179

Please sign in to comment.