Node.js - Resource interpreted as Script but transferred with MIME type text/plain
Try comment out that last response.end. Don't think you need it.
response.end();
});
// response.end();
}
exports.route = route;
I suspect that response.end is getting called immediately before the one inside the fs.readfile callback has time to execute, maybe closing off the headers on the server not giving the correct header "Content-Type": 'text/javascript' a chance to get sent..
Tried it on your code, worked for me..