here is my issue.
I never wrote something in node without using express so i find it difficult to create a server with basic APIs.
Basically what I found on the internet is this:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
however I don’t see How I can implement /index.html and /getData. This code will run on a Raspberry pie, this is why I shouldnt use libraries. Basically I have no much space.
Many thanks,
h
You’ll need to manually inspect the URL in the request and handle each case separate: