Eric Whale

Setup npm script for client/server

...@@ -14,8 +14,7 @@ const root = ReactDOM.createRoot(document.getElementById("root")); ...@@ -14,8 +14,7 @@ const root = ReactDOM.createRoot(document.getElementById("root"));
14 root.render( 14 root.render(
15 <BrowserRouter> 15 <BrowserRouter>
16 <Routes> 16 <Routes>
17 - // root route is for chatroom 17 + <Route path="/" element={<App />} /> // App = chatroom
18 - <Route path="/" element={<App />} />
19 <Route path="/login" element={<Login />} /> 18 <Route path="/login" element={<Login />} />
20 <Route path="/signup" element={<Signup />} /> 19 <Route path="/signup" element={<Signup />} />
21 <Route path="/userroom" element={<Userroom />} /> 20 <Route path="/userroom" element={<Userroom />} />
......
This diff is collapsed. Click to expand it.
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
5 "main": "server.js", 5 "main": "server.js",
6 "scripts": { 6 "scripts": {
7 "start": "node server.js", 7 "start": "node server.js",
8 - "server": "nodemon server.js" 8 + "server": "nodemon server.js",
9 + "client": "npm start --prefix client",
10 + "dev": "concurrently \"npm run client\" \"npm run server\""
9 }, 11 },
10 "repository": { 12 "repository": {
11 "type": "git", 13 "type": "git",
...@@ -23,6 +25,7 @@ ...@@ -23,6 +25,7 @@
23 "mongoose": "^6.3.4" 25 "mongoose": "^6.3.4"
24 }, 26 },
25 "devDependencies": { 27 "devDependencies": {
28 + "concurrently": "^7.2.1",
26 "nodemon": "^2.0.16" 29 "nodemon": "^2.0.16"
27 } 30 }
28 } 31 }
......