From 86122357a6a324120fff7660ab57da2b4c9a1b67 Mon Sep 17 00:00:00 2001 From: monsterkrampe Date: Tue, 30 Aug 2022 13:12:12 +0200 Subject: [PATCH] Make fetch endpoint depend on environment --- frontend/src/components/app.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/app.tsx b/frontend/src/components/app.tsx index 7369a0b..84c25ec 100644 --- a/frontend/src/components/app.tsx +++ b/frontend/src/components/app.tsx @@ -44,7 +44,7 @@ function App() { () => { setLoading(true); - fetch('http://localhost:8080/solve', { + fetch(`${process.env.NODE_ENV === 'development' ? '//localhost:8080' : ''}/solve`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -75,11 +75,10 @@ function App() { label="Put your code here:" helperText={( <> - For more info on the syntax, have a look - here - . + For more info on the syntax, have a + look here. -)} + )} multiline fullWidth variant="filled"