Compare commits

...

3 Commits

@ -37,7 +37,7 @@ module.exports = function budoExpress(options = {}) {
}; };
if (process.env.BUDO_BUILD === "1") { if (process.env.BUDO_BUILD === "1") {
bundle(context); return bundle(context);
} else { } else {
let productionHost = defaultValue(options.host, "::"); let productionHost = defaultValue(options.host, "::");
let developmentHost = (options.allowUnsafeHost) ? productionHost : "127.0.0.1"; let developmentHost = (options.allowUnsafeHost) ? productionHost : "127.0.0.1";
@ -46,12 +46,12 @@ module.exports = function budoExpress(options = {}) {
let developmentMode = getDevelopmentMode(developmentModeSetting); let developmentMode = getDevelopmentMode(developmentModeSetting);
if (developmentMode) { if (developmentMode) {
developmentServer({ return developmentServer({
... context, ... context,
host: developmentHost host: developmentHost
}); });
} else { } else {
productionServer({ return productionServer({
... context, ... context,
host: productionHost host: productionHost
}); });

@ -24,7 +24,7 @@ module.exports = function bundle({ options, staticPath, entryPaths }) {
return Promise.try(() => { return Promise.try(() => {
return mkdirAsync(targetFolder, { recursive: true }); return mkdirAsync(targetFolder, { recursive: true });
}).then(() => { }).then(() => {
browserifyInstance return browserifyInstance
.bundle() .bundle()
.pipe(fs.createWriteStream(targetBundlePath)) .pipe(fs.createWriteStream(targetBundlePath))
.on("finish", () => { .on("finish", () => {

@ -90,4 +90,5 @@ module.exports = function ({ options, staticPath, staticBasePath, entryPaths, ho
devServer.reload("*"); devServer.reload("*");
}); });
}); });
return devServer;
}; };

@ -1,7 +1,7 @@
"use strict"; "use strict";
module.exports = function productionServer({ options, host }) { module.exports = function productionServer({ options, host }) {
options.expressApp return options.expressApp
.listen({ port: options.port, host: host }) .listen({ port: options.port, host: host })
.on("listening", (_event) => { .on("listening", (_event) => {
console.log(`Production server running on ${(host === "::") ? "*" : host}:${options.port}`); console.log(`Production server running on ${(host === "::") ? "*" : host}:${options.port}`);

@ -1,11 +1,11 @@
{ {
"name": "budo-express", "name": "@f0x52/budo-express",
"description": "A small wrapper to integrate Budo with an Express application", "description": "A small wrapper to integrate Budo with an Express application",
"version": "1.0.8", "version": "1.0.8",
"main": "index.js", "main": "index.js",
"repository": "http://git.cryto.net/joepie91/budo-express.git", "repository": "http://git.cryto.net/f0x/budo-express.git",
"bugs": { "bugs": {
"url": "https://git.cryto.net/joepie91/budo-express/issues" "url": "https://git.cryto.net/f0x/budo-express/issues"
}, },
"author": "Sven Slootweg <admin@cryto.net>", "author": "Sven Slootweg <admin@cryto.net>",
"license": "WTFPL OR CC0-1.0", "license": "WTFPL OR CC0-1.0",

Loading…
Cancel
Save