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", "version": "0.0.1",
"description": "", "description": "",
"author": "", "author": "",
@ -23,10 +23,12 @@
"@nestjs/common": "^9.0.0", "@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0", "@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0", "@nestjs/platform-express": "^9.0.0",
"@nestjs/platform-socket.io": "^9.4.0",
"@nestjs/websockets": "^9.4.0", "@nestjs/websockets": "^9.4.0",
"cors": "^2.8.5",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0", "rxjs": "^7.2.0",
"socket.io": "^4.6.1", "socket.io-client": "^4.6.1",
"uuid": "^9.0.0" "uuid": "^9.0.0"
}, },
"devDependencies": { "devDependencies": {

View File

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

View File

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