Added docker deployment, but the thing is broken, I guess a change in node js...

This commit is contained in:
Joe Tretter
2024-07-25 16:28:54 -05:00
parent dcbc6da170
commit 3b6fa6ecb3
3 changed files with 25 additions and 1 deletions

View File

@@ -100,12 +100,17 @@ http.createServer(function(req, res) {
console.log("Full path " + filePath + " [" + contentType + "]" );
try {
console.log("A");
var stat = fs.statSync(filePath);
console.log("B");
var readStream = fs.createReadStream(filePath);
console.log("C");
res.writeHead(200, {"Content-Type":contentType});
console.log("D");
readStream.pipe(res); // this will do a res.end() by its own.
console.log("E");
} catch (ex) {
res.writeHead(404,{"Content-Type":"text/html"});
@@ -115,7 +120,9 @@ http.createServer(function(req, res) {
}
}
}
}).listen(8001,'127.0.0.1');
}).listen(8001,'0.0.0.0');
console.log("server started.");
console.log(__dirname);
// Send the server side event - consider that this response never ends, so no res.end() is called whatsowever!
function sendSSE(req, res) {