From f338e1457708f559ab6d0d036a2a95c7d1855cf9 Mon Sep 17 00:00:00 2001 From: E Date: Sun, 7 Mar 2021 22:51:31 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 2 ++ client/src/api/index.ts | 3 +-- client/src/pages/SessionPictures.tsx | 6 +++--- client/src/settings.ts | 3 --- 4 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 client/src/settings.ts diff --git a/client/src/App.tsx b/client/src/App.tsx index e295310..946fcbe 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -5,6 +5,8 @@ import { BrowserRouter, Switch, Route } from 'react-router-dom' import { Dashboard } from './pages/Dashboard' import { Session } from './pages/Session' +console.log('ENV', process.env.NODE_ENV) + function App() { return ( diff --git a/client/src/api/index.ts b/client/src/api/index.ts index 535c983..46eb33f 100644 --- a/client/src/api/index.ts +++ b/client/src/api/index.ts @@ -1,8 +1,7 @@ import { Client } from '../types' import axios from 'axios' -import settings from '../settings' -if (settings.env === 'jank') { +if (process.env.NODE_ENV === 'development') { const host = 'http://192.168.1.107:5000' axios.defaults.baseURL = host } diff --git a/client/src/pages/SessionPictures.tsx b/client/src/pages/SessionPictures.tsx index 6898c43..d80aecc 100644 --- a/client/src/pages/SessionPictures.tsx +++ b/client/src/pages/SessionPictures.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useState } from 'react' -import { Button, Card, message, Modal, PageHeader, Spin } from 'antd' +import { Card, message, Modal, PageHeader, Spin } from 'antd' import { getSession } from '../api' -import settings from '../settings' type Props = { clientId: string @@ -36,7 +35,8 @@ export const SessionPictures = ({ clientId }: Props) => { const closeModal = () => setActiveUrl(null) - const host = settings.env === 'jank' ? 'http://192.168.1.107:5000' : '' + const host = + process.env.NODE_ENV === 'development' ? 'http://192.168.1.107:5000' : '' if (!urls?.length) return null diff --git a/client/src/settings.ts b/client/src/settings.ts deleted file mode 100644 index 1dc40a7..0000000 --- a/client/src/settings.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - env: 'prod', -}