updating env variables
This commit is contained in:
@@ -10,13 +10,15 @@ const App: React.FC<unknown> = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const getFeatureFlags = async () => {
|
const getFeatureFlags = async () => {
|
||||||
|
console.log(
|
||||||
|
`${import.meta.env.VITE_API_URL}/api/featureFlags?keys=flying-pilots&label=${import.meta.env.MODE}`
|
||||||
|
);
|
||||||
try {
|
try {
|
||||||
const featureFlagKeys: string = 'flying-pilots';
|
const featureFlagKeys: string = 'flying-pilots';
|
||||||
const response: AxiosResponse = await axios.get(
|
const response: AxiosResponse = await axios.get(
|
||||||
`${process.env.API_URL}/api/featureFlags?keys=${featureFlagKeys}&label=${process.env.NODE_ENV}`
|
`${import.meta.env.VITE_API_URL}/api/featureFlags?keys=${featureFlagKeys}&label=${import.meta.env.MODE}`
|
||||||
);
|
);
|
||||||
const featureFlags: { key: string; enabled: boolean }[] = response.data;
|
const featureFlags: { key: string; enabled: boolean }[] = response.data;
|
||||||
console.log(featureFlags);
|
|
||||||
|
|
||||||
if (featureFlags.length > 0) {
|
if (featureFlags.length > 0) {
|
||||||
appContext.dispatch({
|
appContext.dispatch({
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ const SiteNav: React.FC<unknown> = () => {
|
|||||||
};
|
};
|
||||||
const appContext = useAppContext();
|
const appContext = useAppContext();
|
||||||
|
|
||||||
console.log(accounts);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Navbar
|
<Navbar
|
||||||
classNames={{
|
classNames={{
|
||||||
|
|||||||
8
app/src/vite-env.d.ts
vendored
8
app/src/vite-env.d.ts
vendored
@@ -1 +1,9 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_API_URL: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user