Skip to content

Commit 8488a88

Browse files
committed
fix(frontend): use inlined en var instead of dynamic
1 parent 7e1661f commit 8488a88

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

frontend/src/app/utilities/useApi.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ import { useCallback } from "react";
33
import { useAppContext, useAppDispatchContext } from "../contexts/AppContext";
44
import { Page, Sample, SampleCreate, SampleUpdate } from "@/app/types";
55

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

107
/**
118
* Create a new AXIOS instance to query the API
129
* See https://www.npmjs.com/package/axios
1310
*/
1411
const api = axios.create({
15-
baseURL: `${env.NEXT_PUBLIC_BIOSTACK_API_HOST ?? 'http://localhost'}/sample`,
12+
baseURL: `${process.env.NEXT_PUBLIC_BIOSTACK_API_HOST ?? 'http://localhost'}/sample`,
1613
timeout: 3000,
1714
headers: {
1815
'Accept': 'application/json',

0 commit comments

Comments
 (0)