Skip to content

Commit 7dc1160

Browse files
authored
Merge pull request #6 from oslabs-beta/ahsan-branch
Fixed tutorial and added production file static path
2 parents 71e1bec + fb49bdb commit 7dc1160

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

app/src/components/top/NavBar.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,18 @@ const NavBar = (props) => {
173173
>
174174
ReacType
175175
</Typography>
176+
<Link to="/tutorial" style={{ textDecoration: 'none' }}>
177+
<Button
178+
variant="contained"
179+
color="secondary"
180+
style={{ minWidth: '137.69px' }}
181+
onClick={clearWorkspace}
182+
className="navbarButton"
183+
id="navbarButton"
184+
>
185+
Tutorial
186+
</Button>
187+
</Link>
176188
{/* ==================================Dashboard Button================================================== */}
177189
{state.isLoggedIn ? (
178190
<Link to="/dashboard" style={{ textDecoration: 'none' }}>

app/src/public/styles/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body {
1414
margin: 0;
1515
padding: 0;
1616
font-family: 'Roboto','Raleway', sans-serif;
17-
font-size: 0.8 em;
17+
font-size: 0.9 em;
1818
font-weight: 400;
1919
overflow: hidden;
2020
}

app/src/tutorial/Tutorial.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { makeStyles } from '@material-ui/core/styles';
33
import Card from '@material-ui/core/Card';
4+
import CardContent from '@mui/material/CardContent';
45
import CardActions from '@material-ui/core/CardActions';
56
import Typography from '@material-ui/core/Typography';
67
import Container from '@material-ui/core/Container';

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
"js-cookie": "^3.0.1",
163163
"localforage": "^1.10.0",
164164
"lodash": "^4.17.21",
165+
"mongoose": "^5.9.22",
165166
"node-fetch": "^2.6.1",
166167
"passport": "^0.6.0",
167168
"passport-github2": "^0.1.12",
@@ -228,7 +229,7 @@
228229
"jest-environment-jsdom": "^28.1.3",
229230
"mini-css-extract-plugin": "^0.9.0",
230231
"mongodb": "^3.5.9",
231-
"mongoose": "^5.9.22",
232+
232233
"node-sass": "^7.0.1",
233234
"nodemon": "^2.0.19",
234235
"react": "^17.0.2",

server/server.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ app.delete(
188188
(req, res) => res.status(200).json(res.locals.deleted)
189189
);
190190

191+
192+
//if in production mode, statically serve everything in the build folder on the route '/dist'
193+
if (process.env.NODE_ENV == 'production'){
194+
app.use('/dist', express.static(path.join(__dirname, '../dist')));
195+
196+
// serve index.html on the route '/'
197+
app.get('/', (req, res) => {
198+
return res.status(200).sendFile(path.join(__dirname, '../index.html'));
199+
});
200+
}
201+
191202
app.get('/', function(req, res) {
192203
res.send('Houston, Caret is in orbit!');
193204
});

0 commit comments

Comments
 (0)