Sign inSign up

na4va4/js_socketio

By na4va4

•Updated almost 2 years ago

Basic Socket.IO application integrated with an Express.js server.

Image
0

347

na4va4/js_socketio repository overview

⁠js_socketio

⁠Table of Contents

  1. General Info⁠
  2. Technologies⁠
  3. Installation⁠

⁠General Info


This project is a basic Socket.IO application integrated with an Express.js server. It sets up a WebSocket server and client communication to demonstrate real-time messaging between a server and a browser.

  • Server Functionalities:

    • Sends a message to the client upon connection: "Hello from the Socket.IO server".
    • Listens for messages from the client and logs them to the console.
    • Handles client disconnections.
  • Client Functionalities:

    • Receives and displays the server message.
    • Sends a custom message to the server via a button click.

⁠Technologies


A list of technologies used within the project:

⁠Installation


Follow these steps to install and run the project:

⁠Via GitHub

Ensure you have Node.js installed on your machine:

node --version  
npm --version

Copy the repository

git clone https://github.com/nava2105/js_socketio.git

Enter the directory

cd ../js_socketio

Install the dependencies

npm install  

Run the server

node app.js

Open a browser and enter to Server: http://localhost:8000⁠

Open a browser and enter to Message: http://localhost:8000/api/message⁠

Or to review the endpoints in Swagger enter to http://localhost:8000/api-docs⁠

⁠Via Docker-hub

Pull the image from Docker-hub

docker pull na4va4/js_socketio

Start a container from the image

docker run -p 8000:8000 na4va4/js_socketio

Open a browser and enter to Server: http://localhost:8000⁠

Open a browser and enter to Message: http://localhost:8000/api/message⁠

Or to review the endpoints in Swagger enter to http://localhost:8000/api-docs⁠

Tag summary

Content type

Image

Digest

sha256:5634a7195…

Size

392.4 MB

Last updated

almost 2 years ago

docker pull na4va4/js_socketio