{"size": 742, "ext": "js", "max_stars_repo_path": "index.js", "max_stars_repo_name": "wahengchang/web-server", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "index.js", "max_issues_repo_name": "wahengchang/web-server", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "index.js", "max_forks_repo_name": "wahengchang/web-server", "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": 26.5, "max_line_length": 84, "alphanum_fraction": 0.5350404313}


var static = require('node-static'),
    port = 8080,
    http = require('http');


var file = new static.Server('./', {
    cache: 3600,
    gzip: true
});

console.log("Server starts: localhost:8080")

http.createServer(function(request, response) {
    request.addListener('end', function() {
        file.serve(request, response, function(err, result) {
            if (err) {
                console.error("Error serving " + request.url + " - " + err.message);
                // Respond to the client
                response.writeHead(err.status, err.headers);
                response.end();
            } else {
                console.log("Serving file: " + request.url)
            }
        });
    }).resume();
}).listen(port);