mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
use new response module for index
This commit is contained in:
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user