Skip to content
Advertisement

How to store data from a MariaDB in my node.js environment

I have a MariaDB that stores Energy-Data like voltage, frequency and so on. My aim is to visualize the data in a Web-application. Though i achieved to connect the MariaDB to node.js and log the data on a specific port thanks to the code below, i don’t have a clue how to store this data for further mathematic operations or visualizations.

How can i store the data for further operations?

JavaScript

Advertisement

Answer

This question is quite broad.

It sounds like you need to set up a frontend and call fetch on your endpoint, something like:

JavaScript

Your data will be interpolated into HTML then. You will need to iterate over it.

The “storage” will take place in the variable you define in the second .then(yourData) of the promise for you to do further operations on.

You should search for tutorials like “set up frontend with maria db database and node backend”.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement