use new response module for index

This commit is contained in:
jomo
2015-04-20 22:19:57 +02:00
parent 8dc55442b1
commit 0b0882e63d
3 changed files with 13 additions and 9 deletions

View File

@@ -3,17 +3,16 @@ var path = require("path");
var jade = require("jade");
// compile jade
var index = jade.compileFile(path.join(__dirname, "../views/index.jade"));
var index = jade.compileFile(path.join(__dirname, "..", "views", "index.jade"));
module.exports = function(req, res) {
module.exports = function(req, callback) {
var html = index({
title: "Crafatar",
domain: "https://" + req.headers.host,
config: config
});
res.writeHead(200, {
"Content-Length": Buffer.byteLength(html, "UTF-8"),
"Content-Type": "text/html; charset=utf-8"
callback({
body: html,
type: "text/html; charset=utf-8"
});
res.end(html);
};