{"size": 578, "ext": "js", "max_stars_repo_path": "1_NodeJS_Up_and_Running/asyncOpenAndWrite.js", "max_stars_repo_name": "abhinavmish96/NODE_COURSE", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "1_NodeJS_Up_and_Running/asyncOpenAndWrite.js", "max_issues_repo_name": "abhinavmish96/NODE_COURSE", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "1_NodeJS_Up_and_Running/asyncOpenAndWrite.js", "max_forks_repo_name": "abhinavmish96/NODE_COURSE", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.1304347826, "max_line_length": 71, "alphanum_fraction": 0.5882352941}
// load http module
var http = require('http');
var fs = require('fs');

// create http server
http.createServer((req,res)=>{

    // open and read in helloWorld.js
    fs.readFile('helloWorld.js', 'utf-8', function(err, data){
        
        // content header
        res.writeHead(200, {'content-type': 'text/plain'});

        if(err) res.write('Could not find or open file for reading\n');
        else
        res.write(data);
        res.end();
    });    
}).listen(8124, function(){
    console.log('bound to port 8124');
});

console.log("Server is running on 8124");