|
@ -1,9 +1,6 @@ |
|
|
//sending static content
|
|
|
//sending static content
|
|
|
const includes = require('../includes/includes.js'); |
|
|
const includes = require('../includes/includes.js'); |
|
|
|
|
|
|
|
|
//used for file IO
|
|
|
|
|
|
const utils = require('../utils/utils.js'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//used to append static content to result
|
|
|
//used to append static content to result
|
|
|
const contentLoader = require('../includes/staticContentServer.js'); |
|
|
const contentLoader = require('../includes/staticContentServer.js'); |
|
@ -40,11 +37,11 @@ module.exports= |
|
|
const file = "../admin/admin.js"; |
|
|
const file = "../admin/admin.js"; |
|
|
|
|
|
|
|
|
var templateContext = Object(); |
|
|
var templateContext = Object(); |
|
|
Promise.all([includes.fetchTemplate("admin/adminMain.html")], |
|
|
|
|
|
|
|
|
Promise.all([includes.fetchTemplate("admin/adminMain.html"), |
|
|
includes.printAdminHeader(templateContext), |
|
|
includes.printAdminHeader(templateContext), |
|
|
require(file).main(request, clientAddress, templateContext, filename), |
|
|
require(file).main(request, clientAddress, templateContext, filename), |
|
|
includes.printFooter(templateContext) |
|
|
|
|
|
).then(function(content) |
|
|
|
|
|
|
|
|
includes.printFooter(templateContext), |
|
|
|
|
|
]).then(function(content) |
|
|
{ |
|
|
{ |
|
|
result.write(whiskers.render(content[0], templateContext)); |
|
|
result.write(whiskers.render(content[0], templateContext)); |
|
|
result.end(); |
|
|
result.end(); |
|
|