sbx-server-gateway-socket
v0.0.2
Published
sbx-server-gateway-socket
Downloads
2
Readme
sbx-server-gateway-socket
sbx-server-gateway-socket module
Requirements
- node >= 10
- sbx >=0.7.1
Peer dependencies
"jsonwebtoken": "^8.5.1",
"nats": "^1.3.2",
"socket.io": "^2.2.0",
"lodash": "^4.17.15"
Installation
$ sbx install sbx-server-gateway-socket
Use package:
const Socket = require('sbx-server-socket');
module.exports = new Socket({
controllerList: __dircontrollers, //Load with dir
eventList: __direvents,
nats: __config.connections.nats, //Nats mq config
publicKey: fs.readFileSync(__dirconfig + '/rsa.pub', 'utf-8'),
privateKey: fs.readFileSync(__dirconfig + '/rsa', 'utf-8'),
port: __config.socket,
rolesList: {
admin: 0,
developer: 1,
manager: 2,
devops: 4,
guest: 5
}
});
Developers
- Viktor Fischer
- Konstantin Fastov
- Kirill Birykov
FAQ
- eventList - object with routes or string directory path route exmaple {'POST://test(/)': {access: ['admin'],action: 'makeAction'},
- controllerList - object with methods or string directory path
- port - integer
- rolesList - object with roles like {admin:3,client:1} isAll added by default
- privateKey - rsa private key, optional if server only read token (https://www.csfieldguide.org.nz/en/interactives/rsa-key-generator/)
- publicKey - rsa public key - required to verify token
License
Copyright (c) 2019 Sobix Group LLC