feature(html) html -> tmpl: 2 x times speed up

This commit is contained in:
coderaiser 2015-06-10 12:28:02 -04:00
parent c9bbf0cf2b
commit d533a4259d
14 changed files with 9 additions and 8 deletions

View file

@ -18,7 +18,7 @@
FILES_HTML = 'file|path|link|pathLink|media',
FILES_HTML_ROOT = 'view/media-tmpl|config-tmpl|upload',
funcs = [],
DIR_HTML = '/html/',
DIR_HTML = '/tmpl/',
DIR_HTML_FS = DIR_HTML + 'fs/',
DIR_JSON = '/json/';
@ -78,7 +78,7 @@
else
path = DIR_HTML_FS + name;
path += '.html';
path += '.hbs';
} else if (isJSON) {
path = DIR_JSON + name + '.json';
}

View file

@ -2,7 +2,7 @@
'use strict';
var DIR = __dirname + '/../../',
DIR_HTML = DIR + 'html/',
DIR_HTML = DIR + 'tmpl/',
DIR_LIB = DIR + 'lib/',
DIR_SERVER = __dirname + '/',
DIR_FS = DIR_HTML + 'fs/',
@ -23,7 +23,7 @@
CloudFunc = require(DIR_LIB + 'cloudfunc'),
PATH_INDEX = DIR_FS + 'index.html',
PATH_INDEX = DIR_FS + 'index.hbs',
TMPL_PATH = [
'file',
@ -97,7 +97,7 @@
callback();
} else {
filesList = TMPL_PATH.map(function(name) {
var path = DIR_FS + name + '.html';
var path = DIR_FS + name + '.hbs';
paths[path] = name;
@ -143,9 +143,10 @@
request : request,
response : response,
gzip : true,
name : name
name : name,
mime : 'text/html'
};
console.log(p.mime, '...')
if (!isAuth && !isFS)
callback();
else if (isAuth) {
@ -164,7 +165,7 @@
if (!error)
buildIndex(dir, function(error, data) {
p.name = PATH_INDEX;
console.log(p, '88888')
if (error)
ponse.sendError(error, p);
else