var fs = require("fs"); exports.index = function(req, res) { var id = fs.readFile("./html/index.html", function(err, data) { if (err == null) { res.type("text/html"); res.status(200).send(data); } else { res.type("text/html"); res.status(404).send("404

404

Page not found

"); } }); } exports.inc = function(req, res) { var options = { root: global.rootpath + "/html/inc/" }; res.sendFile(req.params.file, options, function(err) { if (err) { console.log(err); res.status(err.status).end(); } }); } exports.img = function(req, res) { var options = { root: global.rootpath + "/html/inc/images" }; res.sendFile(req.params.file, options, function(err) { if (err) { console.log(err); res.status(err.status).end(); } }); }