Skip to content

Commit

Permalink
fix: base url undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
binodnepali committed Apr 29, 2024
1 parent cd237c0 commit c81c632
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/server/getProfile.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Profile } from "../types/Profile.ts";

const env = Deno.env.toObject();
const baseurl = env.BASE_URL || "http://localhost:8000/api";

export const getProfile = async () => {
const baseurl = Deno.env.get("BASE_URL") || "http://localhost:8000/api";

const response = await fetch(`${baseurl}/profile`);
return await response.json() as Profile;
};
Expand Down

0 comments on commit c81c632

Please sign in to comment.