# Sending data from node-red to local webpage

**URL:** <https://discourse.nodered.org/t/sending-data-from-node-red-to-local-webpage/18826>\
**Category:** General\
**Created:** [5 December 2019 15:48 UTC](https://discourse.nodered.org/t/sending-data-from-node-red-to-local-webpage/18826 "2019-12-05T15:48:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![YLM](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@YLM](https://discourse.nodered.org/u/YLM)\
**Post date:** [5 December 2019 15:48 UTC](https://discourse.nodered.org/t/sending-data-from-node-red-to-local-webpage/18826/1 "2019-12-05T15:48:29Z")

</div>

I'd like some help to my project, I do not know how to proceed.

Actually, I have a python code which send data to mosquitto and in my node I have a mqtt listener which get my data from my python code. Then I send those data to influxdb and then I use grafana to display my data in a time series graph. This works perfectly. My problem is that grafana allow you to display data with timeseries. Or I'd like to make X/Y plot.  
So my idea is, from node-red and my MQTT listener, I send the data to a personal web page (this webpage could run locally in a local server, let's say localhost:1234 for example). On this server I run my index.html with some javascript on it and the plotly.js library which allows to make nice plot.

I have completly no idea how to send the data from node-red to a external webpage running on a local server... Someone could orientate me ? If you guys know some links or tutorial for this, it would be great.  
Thank you

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [5 December 2019 16:09 UTC](https://discourse.nodered.org/t/sending-data-from-node-red-to-local-webpage/18826/2 "2019-12-05T16:09:12Z")

</div>

[Create an http-endpoint](https://cookbook.nodered.org/#http-endpoints) and serve the data there.

From the webpage (running with a server), make a request to the http endpoint.

---

<div class="post-metadata">

**Author:** ![YLM](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@YLM](https://discourse.nodered.org/u/YLM)\
**Post date:** [5 December 2019 16:24 UTC](https://discourse.nodered.org/t/sending-data-from-node-red-to-local-webpage/18826/3 "2019-12-05T16:24:23Z")

</div>

Ok great, thank you for you help

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 December 2019 19:16 UTC](https://discourse.nodered.org/t/sending-data-from-node-red-to-local-webpage/18826/4 "2019-12-05T19:16:09Z")

</div>

> [@YLM](#):
>
> So my idea is, from node-red and my MQTT listener, I send the data to a personal web page (this webpage could run locally in a local server, let's say localhost:1234 for example). On this server I run my index.html with some javascript on it and the plotly.js library which allows to make nice plot.

Do you realise that you could do all of this from within Node-RED?

Node-RED has two web servers already defined. 1 for the admin tasks including the editor. The other serves up user-facing stuff including static assets, Dashboard and uibuilder.

If you already have some front-end code, then you can serve that using the static folder. But if you want to go further and have a dedicated websockets channel for communications between Node-RED and your front-end then uibuilder can do that and will likely work with your existing code with minimal modifications.

---

<div class="post-metadata">

**Author:** ![YLM](https://avatars.discourse-cdn.com/v4/letter/y/59ef9b/32.png) [@YLM](https://discourse.nodered.org/u/YLM)\
**Post date:** [6 December 2019 09:35 UTC](https://discourse.nodered.org/t/sending-data-from-node-red-to-local-webpage/18826/5 "2019-12-06T09:35:40Z")

</div>

Great! I did not know those tools, it's exactly what I need. Thank you for sharing!
