Comparing version 0.1.0-beta-35 to 0.1.0-beta-36
@@ -28,3 +28,4 @@ "use strict"; | ||
config: Type.OBJECT, | ||
cache: Type.OBJECT | ||
cache: Type.OBJECT, | ||
regex: Type.REGEX | ||
}, { | ||
@@ -34,2 +35,3 @@ _construct: function Favicon_construct(config) { | ||
path: '@{basePath}/storage/', | ||
skip: false, | ||
hook: '^\\/assets' | ||
@@ -39,3 +41,4 @@ }, config); | ||
logger.print('Assets.construct', config); | ||
hook.set(new RegExp(this.config.hook), this.onRequest.bind(this)); | ||
this.regex = new RegExp(this.config.hook); | ||
hook.set(this.regex, this.onRequest.bind(this)); | ||
}, | ||
@@ -53,7 +56,13 @@ /** | ||
var maxAge = 60 * 60 * 24 * 30 * 12, // one year | ||
filePath = di.normalizePath(this.config.path + api.parsedUrl.pathname), | ||
var url = api.parsedUrl.pathname, | ||
maxAge = 60 * 60 * 24 * 30 * 12, // one year | ||
filePath, | ||
mimeType; | ||
if (this.config.skip) { | ||
url = url.replace(this.regex, ''); | ||
} | ||
filePath = di.normalizePath(this.config.path + url); | ||
mimeType = this.mimeType(filePath); | ||
@@ -60,0 +69,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Powerful lightweight mvc framework for nodejs", | ||
"version": "0.1.0-beta-35", | ||
"version": "0.1.0-beta-36", | ||
"dependencies" : { | ||
@@ -8,0 +8,0 @@ "mongoose": "3.8.x", |
126109
4059