v3.9.1
Fixes & Dev Support
-
Deprecate
body-parser
in favor ofexpress.json()
-
Previously, we parsed the expiry date using the
ms
package, yet the services consuming this value assumed seconds; we've adjusted those services to ensure that while the input is parsed from ms, we convert to seconds before using -
Add support for plugin hooks on the websocket connections to support a plugin like the following:
const ms = require('ms'); const clients = new Map(); module.exports = { websockets: { onConnect: async (params, websocket) => { clients.set(websocket, {subscribed: Date.now()}); console.log(`${clients.size} clients - new client connected`); }, onDisconnect: async (websocket) => { if (clients.has(websocket)) { const client = clients.get(websocket); clients.delete(websocket); console.log(`${clients.size} clients - client disconnected after ${ms(Date.now() - client.subscribed)}`); } }, }, };