@jcbuisson/express-x 1.5.31 → 1.5.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x",
3
- "version": "1.5.31",
3
+ "version": "1.5.32",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
package/src/server.mjs CHANGED
@@ -340,7 +340,8 @@ export function expressX(prisma, options = {}) {
340
340
 
341
341
  try {
342
342
  const result = await serviceMethod(context, ...args)
343
- app.log('verbose', `client-response ${uid} ${JSON.stringify(result)}`)
343
+ const trimmedResult = JSON.stringify(result).slice(0, 300)
344
+ app.log('verbose', `client-response ${uid} ${trimmedResult}`)
344
345
  socket.emit('client-response', {
345
346
  uid,
346
347
  result,
@@ -386,7 +387,8 @@ export function expressX(prisma, options = {}) {
386
387
  app.log('verbose', `service-event ${service.name} ${action} ${channelName}`)
387
388
  const connectionList = await getChannelConnections(channelName)
388
389
  for (const connection of connectionList) {
389
- app.log('verbose', `emit to ${connection.id} ${service.name} ${action} ${result}`)
390
+ const trimmedResult = JSON.stringify(result).slice(0, 300)
391
+ app.log('verbose', `emit to ${connection.id} ${service.name} ${action} ${trimmedResult}`)
390
392
  const socket = cnx2Socket[connection.id]
391
393
  if (!socket) {
392
394
  continue // SHOULD NOT HAPPEN
@@ -1,7 +1,6 @@
1
1
 
2
2
  import bodyParser from 'body-parser'
3
3
  import axios from 'axios'
4
- import io from 'socket.io-client'
5
4
  import { PrismaClient } from '@prisma/client'
6
5
 
7
6
 
@@ -10,13 +9,7 @@ import { strict as assert } from 'node:assert'
10
9
 
11
10
  import { expressX } from '../src/index.mjs'
12
11
 
13
- const prisma = new PrismaClient({
14
- datasources: {
15
- db: {
16
- url: "file:./dev.db",
17
- },
18
- },
19
- })
12
+ const prisma = new PrismaClient()
20
13
 
21
14
  // `app` is a regular express application, enhanced with services and real-time features
22
15
  const app = expressX(prisma)