@alizadefaig/pos-server 1.2.29 → 1.2.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/server.js CHANGED
@@ -13,6 +13,7 @@ const {internalGuard, originGuard} = require("./app/security");
13
13
  const {isSyncEnabled} = require("./app/sync/config");
14
14
  const multer = require('multer');
15
15
  const {getLogger} = require("./app/logger/Log");
16
+ const netstats = require("./app/netstats");
16
17
 
17
18
 
18
19
 
@@ -69,6 +70,8 @@ const bodyParsers = [
69
70
  express.urlencoded({extended: true, limit: BODY_LIMIT}),
70
71
  upload.any(),
71
72
  ];
73
+ // Запросы из зала (не loopback) и их исход — для диагностики кассы (/local/status.net).
74
+ app.use(netstats.middleware);
72
75
  // Мастер раздаёт фронт телефонам зала (LAN_FRONT): страница и её файлы открыты без ключа и
73
76
  // токена — данных в них нет, а API за ними проверяется ниже. No-op без флага.
74
77
  app.use(require('./app/sync/lanFront').middleware());
@@ -178,6 +181,7 @@ const runExpress = (conf = null) => {
178
181
 
179
182
  // ==== Start Listen ====
180
183
  const hostname = appConfig.host || 'localhost';
184
+ netstats.attach(server, {host: hostname, port});
181
185
  server.listen(port, hostname, async () => {
182
186
  if (hostname === 'localhost') {
183
187
  console.log(`Server started on ${hostname} http://${hostname}:${port}`);