Basic MQTT client integrated with an Express.js server.
179
This project is a basic MQTT client integrated with an Express.js server. It connects to an MQTT broker, publishes a simple "Hello World" message in JSON format, and serves the last published message through an HTTP GET endpoint.
MQTT Publish:
test/hola{"message": "Hello World from MQTT in javascript"}HTTP Endpoint:
/A list of technologies used within the project:
Follow these steps to install and run the project:
Ensure you have Node.js installed on your machine:
node --version
npm --version
Copy the repository
git clone https://github.com/nava2105/js_mqtt.git
Enter the directory
cd ../js_mqtt
Install the dependencies
npm install
Run the server
node app.js
Open a browser and enter to Server: http://localhost:3000
Or to review the endpoints in Swagger enter to http://localhost:3000/api-docs
Pull the image from Docker-hub
docker pull na4va4/js_mqtt
Start a container from the image
docker run -p 3000:3000 na4va4/js_mqtt
Open a browser and enter to Server: http://localhost:3000
Or to review the endpoints in Swagger enter to http://localhost:3000/api-docs
Content type
Image
Digest
sha256:33927d5cf…
Size
58.9 MB
Last updated
almost 2 years ago
docker pull na4va4/js_mqtt