Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ikoabo/server

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ikoabo/server - npm Package Compare versions

Comparing version 1.1.15 to 1.1.16

5

CHANGELOG.md
# CHANGELOG
## [1.1.16] - 2020-11-11
- Adding conditional body request log
- Adding conditional body response log
- Add slave hook to dispatch actions before routes initialization
## [1.1.15] - 2020-11-02

@@ -4,0 +9,0 @@ - Adding GeoJSON date model

1

lib/controllers/cluster.controller.d.ts

@@ -9,2 +9,3 @@ /// <reference types="node" />

preExpress?: () => Promise<void>;
preRoutes?: (app: express.Application) => Promise<void>;
postExpress?: (app: express.Application) => Promise<void>;

@@ -11,0 +12,0 @@ running?: () => Promise<void>;

2

lib/controllers/cluster.controller.js

@@ -142,3 +142,3 @@ "use strict";

return new Promise((resolve) => {
server.initExpress(cluster_1.default.worker, routes).then(resolve);
server.initExpress(cluster_1.default.worker, this._slaveHooks.preRoutes, routes).then(resolve);
});

@@ -145,0 +145,0 @@ }

@@ -14,3 +14,3 @@ /// <reference types="node" />

initMongo(): Promise<any>;
initExpress(worker?: any, routes?: any): Promise<void>;
initExpress(worker?: any, preRoutes?: any, routes?: any): Promise<void>;
get app(): express.Application;

@@ -17,0 +17,0 @@ use(middleware: any, route?: any): void;

@@ -59,3 +59,3 @@ "use strict";

}
initExpress(worker, routes) {
initExpress(worker, preRoutes, routes) {
return new Promise((resolve) => {

@@ -98,16 +98,22 @@ this._worker = worker;

on_finished_1.default(res, (err, resp) => {
const request = {
method: req.method,
url: req.originalUrl,
headers: req.headers
};
const response = {
status: resp.statusCode,
message: resp.statusMessage
};
if (process.env.BODY_TRACE) {
request["body"] = req.body;
}
if (process.env.RESPONSE_TRACE) {
response["body"] = resp.locals;
}
const requestTrace = {
stamp: moment_1.default.utc().toDate().getTime(),
err: err,
req: {
method: req.method,
url: req.originalUrl,
body: req.body,
headers: req.headers
},
res: {
status: resp.statusCode,
message: resp.statusMessage,
locals: resp.locals
},
req: request,
res: response,
worker: this.worker

@@ -132,2 +138,8 @@ };

this._app.use("/version", version_middleware_1.default);
if (preRoutes) {
return preRoutes(this._app).finally(() => {
this._registerRoutes(routes);
resolve();
});
}
this._registerRoutes(routes);

@@ -134,0 +146,0 @@ resolve();

{
"name": "@ikoabo/server",
"version": "1.1.15",
"version": "1.1.16",
"description": "IKOA Business Opportunity Server API",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc