diff --git a/bob_party/Dockerfile b/bob_party/Dockerfile index d3d78bf..e72937a 100644 --- a/bob_party/Dockerfile +++ b/bob_party/Dockerfile @@ -14,7 +14,6 @@ RUN yarn install --frozen-lockfile # Bundle app source COPY bob_party/server.js . -COPY bob_party/index.html . EXPOSE 3000 diff --git a/bob_party/index.html b/bob_party/index.html deleted file mode 100644 index 12e43c8..0000000 --- a/bob_party/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - Node.js Socket.io Chat Application - - - - NodeJs-Socket.on app running successfully!!! - - - \ No newline at end of file diff --git a/bob_party/server.js b/bob_party/server.js index 18912c7..5093689 100644 --- a/bob_party/server.js +++ b/bob_party/server.js @@ -8,10 +8,6 @@ const app = express(); const server = http.createServer(app); const io = new Server(server); -app.get('/', function (req, res) { - res.sendFile(__dirname + '/index.html'); -}); - io.on('connection', (socket) => { console.log(socket.id); diff --git a/bob_party/socketConfig.js b/bob_party/socketConfig.js index caf87a3..0950eb2 100644 --- a/bob_party/socketConfig.js +++ b/bob_party/socketConfig.js @@ -1,4 +1,4 @@ const { io } = require("socket.io-client"); -export const socket = io("https://codefirst.iut.uca.fr/containers/BOB_PARTEAM-server-bobParty"); \ No newline at end of file +export const socket = io("https://codefirst.iut.uca.fr/containers/BOB_PARTEAM-server-bobParty:3000"); \ No newline at end of file diff --git a/bob_party/src/screens/Home.tsx b/bob_party/src/screens/Home.tsx index 58f36b0..459700a 100644 --- a/bob_party/src/screens/Home.tsx +++ b/bob_party/src/screens/Home.tsx @@ -23,6 +23,7 @@ function Home(props: { navigation: any; }) { const { navigation } = props + console.log(socket.connected); //It has to be in the home page that way the database will reload the conversations when the user receive a message een if he is in another page