So. I'm a total noob. And most of my question is geared towards just not understanding data transfer or Web servers properly.
Anyway, I am creating a project which hosts a very simple and lightweight Node.js server. In this server, I need to create a website to be able to view file data which resides on the server. On the server, I have a directory listing that goes something like this...
- info
--- client_IPAddress1
------ dataFile1.info
------ dataFile2.info
------ dataFile3.info
--client_IPAddress2
------ dataFile1.info
------ dataFile2.info
------ dataFile3.info
--client_IPAddress3
------ dataFile1.info
------ dataFile2.info
------ dataFile3.info
On the node server, I need to be able to read this file data, and modifying a table element on an html page to display the contents of the files. So far, all I know how to do is display the html page directly like this...
if(request.method == 'GET' && request.url == '/'){
response.writeHead(200, {"Context-Type": "text/html"});
fs.createReadStream("clientMonitor.html").pipe(response);
Now, I have a button like so...
<div class="refresh-btn" href="http://169.254.0.4:8888/client-data">
<p><b>Refresh</b></p>
</div>
Which I want to be able to refresh that data to display to a table element. So, on the node.js server what do I do here?
}else if(request.method == 'GET' && request.url == "/client-data"){
//TODO
}
I am a complete and total stranger to node.js. A quick solution or a link to a helpful website, or simple a link to a tutorial about data handling that covers topics akin to these would be extremely helpful. I am running this on a Raspberry Pi using Rasbian Jessie. If anyone knows another solution that they could point me for this platform, again, it would help.