From 7c36d56f0a431cf0ca3e8c154afdcac770aa3b05 Mon Sep 17 00:00:00 2001 From: Nanyi Yang <nanyiyang@Nanyis-MacBook-Pro.local> Date: Sat, 2 May 2020 21:12:15 -0700 Subject: [PATCH 1/3] testing --- react-backend/app.js | 4 ++-- react-backend/client/src/components/Start.js | 2 +- react-backend/client/src/css/Start.css | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/react-backend/app.js b/react-backend/app.js index 481c3c6..6339687 100644 --- a/react-backend/app.js +++ b/react-backend/app.js @@ -94,8 +94,8 @@ app.use(function(err, req, res, next) { res.render('error'); }); - -app.listen(3001, () => { +const port = process.env.PORT || 3001 +app.listen(port, () => { console.log("Server is up and listening on 3001...") }) diff --git a/react-backend/client/src/components/Start.js b/react-backend/client/src/components/Start.js index 76864cd..4b05aaf 100644 --- a/react-backend/client/src/components/Start.js +++ b/react-backend/client/src/components/Start.js @@ -500,7 +500,7 @@ class Start extends Component { <Container> <Row> <Col> - <h1>Welcome to eduFY {this.state.s_name} </h1> + <h1 className='welcome-text'>Welcome to eduFY {this.state.s_name} </h1> <p> <Button diff --git a/react-backend/client/src/css/Start.css b/react-backend/client/src/css/Start.css index 745636b..8db1d22 100644 --- a/react-backend/client/src/css/Start.css +++ b/react-backend/client/src/css/Start.css @@ -5,4 +5,5 @@ .form-inputs { margin-bottom: 8px; -} \ No newline at end of file +} + -- GitLab From 92c0182d31e18e74ce3634d40afc207ac4526da3 Mon Sep 17 00:00:00 2001 From: Nanyi Yang <nanyiyang@Nanyis-MacBook-Pro.local> Date: Sat, 2 May 2020 21:17:08 -0700 Subject: [PATCH 2/3] testing pt2 --- react-backend/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react-backend/app.js b/react-backend/app.js index 75a1354..1889c7c 100644 --- a/react-backend/app.js +++ b/react-backend/app.js @@ -35,7 +35,8 @@ app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(cookieParser()); -app.use(express.static(path.join(__dirname, 'public'))); //THIS IS THE ORIGINAL +//app.use(express.static(path.join(__dirname, 'public'))); //THIS IS THE ORIGINAL +app.use('/', express.static(path.join(__dirname, '/client/build'))); // // ================================= ADDITIONAL PORTION BEGIN ===================================== // // Serve static files from the React frontend app -- GitLab From ee27b90a0cbd83858bea6fa96be723d9315756ee Mon Sep 17 00:00:00 2001 From: Nanyi Yang <nanyiyang@Nanyis-MacBook-Pro.local> Date: Sat, 2 May 2020 21:28:17 -0700 Subject: [PATCH 3/3] broke --- react-backend/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react-backend/app.js b/react-backend/app.js index 1889c7c..2d6a7b6 100644 --- a/react-backend/app.js +++ b/react-backend/app.js @@ -36,11 +36,12 @@ app.use(express.urlencoded({ extended: false })); app.use(cookieParser()); //app.use(express.static(path.join(__dirname, 'public'))); //THIS IS THE ORIGINAL -app.use('/', express.static(path.join(__dirname, '/client/build'))); + +//app.use('/', express.static(path.join(__dirname, '/client/build'))); // // ================================= ADDITIONAL PORTION BEGIN ===================================== // // Serve static files from the React frontend app -// app.use(express.static(path.join(__dirname, '../client/build'))) + app.use(express.static(path.join(__dirname, '../client/build'))) // // AFTER defining routes: Anything that doesn't match what's above, send back index.html; (the beginning slash ('/') in the string is important!) // app.get('*', (req, res) => { -- GitLab