Skip to content

Commit

Permalink
fix(frontend): use inlined en var instead of dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
berdal84 committed Jan 27, 2024
1 parent 7e1661f commit 8488a88
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions frontend/src/app/utilities/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ import { useCallback } from "react";
import { useAppContext, useAppDispatchContext } from "../contexts/AppContext";
import { Page, Sample, SampleCreate, SampleUpdate } from "@/app/types";

// Declare a var to load environment variables non inlined
// (note: vars needs to start with NEXT_PUBLIC_ to be available in browser context at runtime)
const env = process.env

/**
* Create a new AXIOS instance to query the API
* See https://www.npmjs.com/package/axios
*/
const api = axios.create({
baseURL: `${env.NEXT_PUBLIC_BIOSTACK_API_HOST ?? 'http://localhost'}/sample`,
baseURL: `${process.env.NEXT_PUBLIC_BIOSTACK_API_HOST ?? 'http://localhost'}/sample`,
timeout: 3000,
headers: {
'Accept': 'application/json',
Expand Down

0 comments on commit 8488a88

Please sign in to comment.