Comparing version
# ack-host - Change Log | ||
All notable changes to this project will be documented here. | ||
## [0.6.2] - 2018-03-20 | ||
- made static and compress work when not an express server | ||
## [0.6.1] - 2017-03-22 | ||
@@ -5,0 +8,0 @@ ### Enhanced |
@@ -14,2 +14,7 @@ const assert = require('assert') | ||
module.exports = function(site, options){ | ||
const routes = routesToArray(site.routeLog) | ||
return testRoutes(routes, options) | ||
} | ||
function testRoutes(routes, options){ | ||
const passing = [] | ||
@@ -97,3 +102,2 @@ const failing = [] | ||
function getRoutePath(route,sample={}){ | ||
@@ -163,2 +167,3 @@ let simplePath = sample.path || route.path | ||
method - limit tests to only matching methods | ||
host - server address | ||
} | ||
@@ -165,0 +170,0 @@ */ |
@@ -201,12 +201,18 @@ "use strict"; | ||
if(path){ | ||
if(options.compress){ | ||
return this.use(route, router.compress(), staticRouter);//gzip compress content | ||
if(options.compress){ | ||
const processor = (req,res,next)=>{ | ||
router.compress(req,res,()=>null) | ||
staticRouter(req,res,next) | ||
} | ||
return this.use(route, staticRouter) | ||
if(path){ | ||
return this.use(route, processor);//gzip compress content | ||
}else{ | ||
return this.use(processor);//gzip compress content | ||
} | ||
}else{ | ||
if(options.compress){//!must come before | ||
return this.use(router.compress(), staticRouter);//gzip compress content | ||
if(path){ | ||
return this.use(route, staticRouter);//gzip compress content | ||
}else{ | ||
return this.use(staticRouter);//gzip compress content | ||
} | ||
return this.use(staticRouter) | ||
} | ||
@@ -213,0 +219,0 @@ |
{ | ||
"name": "ack-host", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Common node hosting functionality to help reduce deployment of repetitious server functionality", | ||
@@ -5,0 +5,0 @@ "main": "ack-host.js", |
1853
0.6%70803
-0.37%24
-4%