index.js 422 B

123456789101112131415161718
  1. var config = require("../../config");
  2. var path = require("path");
  3. var jade = require("jade");
  4. // compile jade
  5. var index = jade.compileFile(path.join(__dirname, "..", "views", "index.jade"));
  6. module.exports = function(req, callback) {
  7. var html = index({
  8. title: "Crafatar",
  9. domain: "https://" + req.headers.host,
  10. config: config
  11. });
  12. callback({
  13. body: html,
  14. type: "text/html; charset=utf-8"
  15. });
  16. };