Skip to content

Commit

Permalink
fix: api host url for all envs
Browse files Browse the repository at this point in the history
  • Loading branch information
gitfrosh committed Apr 15, 2024
1 parent bb99f0e commit 55de93c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions frontend/src/helpers/api.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
let host;
if (process.env.NODE_ENV === "development") {
host = "http://localhost:3001"
} else {
host = "/"
}
const host = `${window.location.protocol}//${window.location.hostname}${window.location.port ? ':' + window.location.port : ''}`;

export async function login(values) {
console.log(host)

const requestOptions = {
method: "POST",
headers: {
Expand Down

0 comments on commit 55de93c

Please sign in to comment.