Commit ce0e9694 authored by Aral Balkan's avatar Aral Balkan
Browse files

Fix regression: web socket server created only once

(when using both advanced routing and DotJS together)
parent d8aec4ae
......@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [17.0.1] - 2021-04-27
### Fixed
- Regression (in 17.0.0): Web Socket server is created only once when using both routes.js file (advanced routing) and DotJS together.
## [17.0.0] - 2021-04-25
### Breaking change
......
......@@ -787,9 +787,10 @@ class Site {
this.createFileWatcher()
}
this.createWebSocketServer()
// If we need to load dynamic routes from a routesJS file, do it now.
if (this.routesJsFile !== undefined) {
this.createWebSocketServer()
const routesJSFilePath = path.resolve(this.routesJsFile)
decache(routesJSFilePath)
require(routesJSFilePath)(this.app)
......@@ -798,7 +799,6 @@ class Site {
// If there are WebSocket routes, create a regular WebSocket server and
// add the WebSocket routes (if any) to the app.
if (this.wssRoutes !== undefined) {
this.createWebSocketServer()
this.wssRoutes.forEach(route => {
this.log(` 🐁 ❨site.js❩ Adding WebSocket (WSS) route: ${route.path}`)
decache(route.callback)
......
{
"name": "@small-tech/site.js",
"version": "17.0.0",
"version": "17.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "@small-tech/site.js",
"version": "17.0.0",
"version": "17.0.1",
"description": "Small Web construction set.",
"keywords": [
"web server",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment