mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
www.js is our 'main' file, it's now at the project's root instead of server.js routes, views, assets are now in lib, too
19 lines
485 B
JavaScript
19 lines
485 B
JavaScript
var config = require("../config");
|
|
var path = require("path");
|
|
var jade = require("jade");
|
|
|
|
// compile jade
|
|
var index = jade.compileFile(path.join(__dirname, "../views/index.jade"));
|
|
|
|
module.exports = function(req, res) {
|
|
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"
|
|
});
|
|
res.end(html);
|
|
}; |