Skip to content

Instantly share code, notes, and snippets.

@clone1018
Created February 2, 2013 03:41
Show Gist options
  • Save clone1018/4696024 to your computer and use it in GitHub Desktop.
Save clone1018/4696024 to your computer and use it in GitHub Desktop.
var simplate;
if (err) return fail(res, 404);
if (stats.isDirectory()) {
var tmp_simp;
new_path = fs_path + path.sep + config.index;
fs.exists(new_path, function(exists) {
if(exists === true) {
tmp_simp = new_path;
} else {
// Serve up autoindex simplate
tmp_simp = fs_path + path.sep + config.simplates.defaults + path.sep + 'autoindex.html';
}
simplate = tmp_simp;
});
simplate = tmp_simp;
console.log(simplate);
} else {
simplate = fs_path;
}
console.log('simplate: ' + simplate);
var content_type = mime.lookup(simplate);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment