@gravity-ui/expresskit
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -13,2 +13,4 @@ /// <reference types="node" /> | ||
run(): void; | ||
private getAppSocket; | ||
private getListenTarget; | ||
} |
@@ -17,2 +17,4 @@ "use strict"; | ||
var _a; | ||
this.getAppSocket = () => process.env.APP_SOCKET || this.config.appSocket; | ||
this.getListenTarget = (appSocket) => process.env.APP_PORT || this.config.appPort || appSocket || DEFAULT_PORT; | ||
this.nodekit = nodekit; | ||
@@ -29,10 +31,6 @@ this.config = nodekit.config; | ||
(0, router_1.setupRoutes)(this.nodekit.ctx, this.express, routes); | ||
} | ||
run() { | ||
const appSocket = process.env.APP_SOCKET || this.config.appSocket; | ||
const listenTarget = process.env.APP_PORT || this.config.appPort || appSocket || DEFAULT_PORT; | ||
const listenTargetType = appSocket === listenTarget ? 'socket' : 'port'; | ||
this.nodekit.ctx.log(`Listening on ${listenTargetType} ${listenTarget}`); | ||
const appSocket = this.getAppSocket(); | ||
const listenTarget = this.getListenTarget(appSocket); | ||
if (appSocket && | ||
listenTargetType === 'socket' && | ||
listenTarget === appSocket && | ||
cluster_1.default.isPrimary && | ||
@@ -42,2 +40,8 @@ fs_1.default.existsSync(appSocket)) { | ||
} | ||
} | ||
run() { | ||
const appSocket = this.getAppSocket(); | ||
const listenTarget = this.getListenTarget(appSocket); | ||
const listenTargetType = appSocket === listenTarget ? 'socket' : 'port'; | ||
this.nodekit.ctx.log(`Listening on ${listenTargetType} ${listenTarget}`); | ||
this.httpServer = this.express.listen(listenTarget, () => { | ||
@@ -44,0 +48,0 @@ this.nodekit.ctx.log('App is running'); |
{ | ||
"name": "@gravity-ui/expresskit", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Express.js wrapper for NodeKit-based apps", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24311
479