Skip to content

Commit

Permalink
Adding an embryo to a server
Browse files Browse the repository at this point in the history
Start the Client: cd client ; npm start  # localhost:3000
Start the server: npm start              # localhost:3001
  • Loading branch information
etnt committed Sep 4, 2024
1 parent 5610fcf commit 8046cf0
Show file tree
Hide file tree
Showing 8 changed files with 939 additions and 18 deletions.
3 changes: 3 additions & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ const App: React.FC = () => {
formattedHistory += `${moveNumber}. ${whiteMove} ${blackMove}\n`;
}
setMoveHistory(formattedHistory.trim());
fetch('http://localhost:3001/api/game')
.then(response => response.json())
.then(data => console.log(data));
}, [game, fullHistory]);

/**
Expand Down
106 changes: 103 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "mychess",
"version": "1.0.0",
"main": "server.js",
"main": "server/src/index.ts",
"scripts": {
"start": "node server.js",
"start": "ts-node server/src/index.ts",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"server": "nodemon server.js",
"client": "cd client && npm start",
Expand All @@ -22,7 +22,9 @@
"path": "^0.12.7"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.3",
"concurrently": "^8.2.2",
"nodemon": "^3.1.4",
"ts-node": "^10.9.2"
Expand Down
Loading

0 comments on commit 8046cf0

Please sign in to comment.