Comparing version 1.0.0-pre4.0 to 1.0.0
@@ -119,3 +119,3 @@ /** | ||
} else if (options.server) { | ||
ServerFactory = loadModule(options.server)(ServerFactory) | ||
ServerFactory = loadModule(options.server, options)(ServerFactory) | ||
} | ||
@@ -129,7 +129,13 @@ const factory = new ServerFactory() | ||
const WebsocketBase = require('./websocket-base') | ||
const wsModule = typeof options.websocket === 'string' ? loadModule(options.websocket) : options.websocket | ||
const wsModule = typeof options.websocket === 'string' ? loadModule(options.websocket, options) : options.websocket | ||
const WebsocketModule = wsModule(WebsocketBase) | ||
const websocketModule = new WebsocketModule() | ||
let wsOptions = { perMessageDeflate: false } | ||
if (websocketModule.wsOptions) { | ||
wsOptions = Object.assign({}, wsOptions, websocketModule.wsOptions()) | ||
} | ||
const Websocket = require('ws') | ||
const wss = new Websocket.Server({ server, perMessageDeflate: false }) | ||
this.emit('verbose', 'websocket.server.config', wsOptions) | ||
wsOptions.server = server | ||
const wss = new Websocket.Server(wsOptions) | ||
this.propagate(websocketModule) | ||
@@ -136,0 +142,0 @@ let webSocketId = 1 |
'use strict' | ||
const flatten = require('reduce-flatten') | ||
const EventEmitter = require('events') | ||
const MiddlewareBase = require('./middleware-base') | ||
@@ -39,3 +40,2 @@ /** | ||
loadMiddlewareModules(mwModules, options) | ||
const MiddlewareBase = require('./middleware') | ||
const stack = this.from(mwModules.map(mwModule => { | ||
@@ -60,6 +60,5 @@ const Middleware = mwModule(MiddlewareBase) | ||
function loadMiddlewareModules (MwModules, options) { | ||
const Middleware = require('./middleware') | ||
MwModules.forEach((MwModule, index) => { | ||
if (typeof MwModule === 'string') { | ||
MwModules[index] = Middleware.load(MwModule, options) | ||
MwModules[index] = MiddlewareBase.load(MwModule, options) | ||
} | ||
@@ -66,0 +65,0 @@ }) |
{ | ||
"name": "lws", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "1.0.0-pre4.0", | ||
"version": "1.0.0", | ||
"description": "The modular web server for productive full-stack development", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/lwsjs/lws.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
134797
1273
1