client connected to chat socket back

This commit is contained in:
kinou-p 2023-06-02 12:59:40 +02:00
parent 7b593831bb
commit a5afd9d247
4 changed files with 613 additions and 533 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{
"name": "chat",
"name": "pong",
"version": "0.0.1",
"description": "",
"author": "",
@ -23,10 +23,12 @@
"@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/platform-socket.io": "^9.4.0",
"@nestjs/websockets": "^9.4.0",
"cors": "^2.8.5",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"socket.io": "^4.6.1",
"socket.io-client": "^4.6.1",
"uuid": "^9.0.0"
},
"devDependencies": {

View File

@ -45,7 +45,7 @@ function Chats(){
const [socket, setSocket] = useState(null);
useEffect(()=> {
// setSocket(io("http://localhost:4001"));
setSocket(io("http://localhost:4001"));
}, [])
useEffect(()=> {

View File

@ -75,18 +75,18 @@ services:
- ./containers/pong:/app
entrypoint: ["sh", "-c" , "npm install && npm run start:dev"]
# chat:
# image: node:latest
# container_name: chat
# working_dir: /app
# ports:
# - 4001:4001
# env_file: .env
# networks:
# - pongNetwork
# volumes:
# - ./containers/chat:/app
# entrypoint: ["sh", "-c" , "npm install && npm run start:dev"]
chat:
image: node:latest
container_name: chat
working_dir: /app
ports:
- 4001:4001
env_file: .env
networks:
- pongNetwork
volumes:
- ./containers/chat:/app
entrypoint: ["sh", "-c" , "npm install && npm run start:dev"]
networks: