hops-express
Advanced tools
Comparing version 9.7.0 to 9.8.0
10
app.js
@@ -11,3 +11,3 @@ 'use strict'; | ||
var hopsConfig = require('hops-config'); | ||
var server = require('hops-server'); | ||
var utils = require('./utils'); | ||
@@ -17,3 +17,3 @@ function createApp(options) { | ||
app.use(helmet()); | ||
app.use(server.rewritePath); | ||
app.use(utils.rewritePath); | ||
app.use( | ||
@@ -30,7 +30,7 @@ express.static(hopsConfig.buildDir, { | ||
); | ||
server.bootstrap(app, hopsConfig); | ||
utils.bootstrap(app, hopsConfig); | ||
if (!options.static) { | ||
var filePath = path.join(hopsConfig.cacheDir, 'server.js'); | ||
if (fs.existsSync(filePath)) { | ||
server.registerMiddleware(app.use(helmet.noCache()), require(filePath)); | ||
utils.registerMiddleware(app.use(helmet.noCache()), require(filePath)); | ||
} else { | ||
@@ -42,3 +42,3 @@ console.log( | ||
} | ||
server.teardown(app, hopsConfig); | ||
utils.teardown(app, hopsConfig); | ||
return app; | ||
@@ -45,0 +45,0 @@ } |
@@ -6,2 +6,10 @@ # Change Log | ||
<a name="9.8.0"></a> | ||
# [9.8.0](https://github.com/xing/hops/compare/v9.7.0...v9.8.0) (2018-01-25) | ||
**Note:** Version bump only for package hops-express | ||
<a name="9.7.0"></a> | ||
@@ -8,0 +16,0 @@ # [9.7.0](https://github.com/xing/hops/compare/v9.6.1...v9.7.0) (2018-01-22) |
'use strict'; | ||
var server = require('hops-server'); | ||
var utils = require('./utils'); | ||
var createApp = require('./app'); | ||
function runServer(options, callback) { | ||
server.run(createApp(options), callback); | ||
utils.run(createApp(options), callback); | ||
} | ||
@@ -16,2 +16,3 @@ | ||
}, | ||
utils: utils, | ||
}; |
{ | ||
"name": "hops-express", | ||
"version": "9.7.0", | ||
"version": "9.8.0", | ||
"description": | ||
@@ -12,3 +12,3 @@ "Express server to enable server-side rendering of hops applications", | ||
"main": "index.js", | ||
"files": ["app.js", "index.js", "commands"], | ||
"files": ["app.js", "index.js", "utils.js", "commands"], | ||
"repository": { | ||
@@ -22,5 +22,4 @@ "type": "git", | ||
"hops-config": "9.5.0", | ||
"hops-server": "9.7.0", | ||
"mime": "^2.2.0" | ||
} | ||
} |
8961
4
7
149
6
- Removedhops-server@9.7.0
- Removedhops-server@9.7.0(transitive)