Added docker deployment, but the thing is broken, I guess a change in node js...
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user