mirror of
https://github.com/Rolands-Laucis/Socio.git
synced 2026-05-15 14:15:57 -06:00
upd
This commit is contained in:
parent
c101f97a0a
commit
ed5a6134b4
2 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ await sequelize.query('INSERT INTO Users VALUES("John", 69);')
|
|||
//set up the WebSocket manager and give it the DB querying function that comes from whatever your DB interface lib provides.
|
||||
//it needs the raw sql string, which can contain formatting parameters - insert dynamic data into the string.
|
||||
//Either you in a wrapper function or your DB interface lib should do the sql validation and sanitization, as this lib does not!
|
||||
const QueryWrap = async (sql='', params={}) => (await sequelize.query(sql, { logging: false, raw: true, replacements: params }))[0]
|
||||
const QueryWrap = async ({ id = 0, ses_id = '', query = '', params = {} } = {}) => (await sequelize.query(query, { logging: false, raw: true, replacements: params }))[0]
|
||||
const manager = new SessionManager({ port: ws_port }, QueryWrap, {verbose:true} )
|
||||
done(`Created SessionManager on port`, ws_port)
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ await sequelize.query('INSERT INTO Users VALUES("John", 69);')
|
|||
//set up the WebSocket manager and give it the DB querying function that comes from whatever your DB interface lib provides.
|
||||
//it needs the raw sql string, which can contain formatting parameters - insert dynamic data into the string.
|
||||
//Either you in a wrapper function or your DB interface lib should do the sql validation and sanitization, as this lib does not!
|
||||
const QueryWrap = async (sql = '', params = {}) => (await sequelize.query(sql, { logging: false, raw: true, replacements: params }))[0]
|
||||
const QueryWrap = async ({ id = 0, ses_id = '', query = '', params = {} } = {}) => (await sequelize.query(query, { logging: false, raw: true, replacements: params }))[0]
|
||||
|
||||
//note that these key and iv are here for demonstration purposes and you should always generate your own. You may also supply any cipher algorithm supported by node's crypto module
|
||||
const ss = new SocioSecurity({ secure_private_key: 'skk#$U#Y$7643GJHKGDHJH#$K#$HLI#H$KBKDBDFKU34534', cipher_iv: 'dsjkfh45h4lu45ilULIY$%IUfdjg', verbose:true })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue