@chainizer/support-app
Advanced tools
Comparing version 1.0.0-alpha.38 to 1.0.0-alpha.50
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.0.0-alpha.50"></a> | ||
# [1.0.0-alpha.50](https://gitlab.com/chainizer/chainizer-support-node/compare/v1.0.0-alpha.49...v1.0.0-alpha.50) (2018-05-29) | ||
### Bug Fixes | ||
* fix app conf override ([2daecbf](https://gitlab.com/chainizer/chainizer-support-node/commit/2daecbf)) | ||
<a name="1.0.0-alpha.38"></a> | ||
@@ -8,0 +19,0 @@ # [1.0.0-alpha.38](https://gitlab.com/chainizer/chainizer-support-node/compare/v1.0.0-alpha.37...v1.0.0-alpha.38) (2018-05-24) |
/// <reference types="node" /> | ||
import { Express } from 'express'; | ||
import { Server } from 'http'; | ||
export interface AppConfig { | ||
port: number; | ||
hostname: string; | ||
} | ||
export declare enum HookType { | ||
@@ -9,0 +5,0 @@ startup = "startup", |
@@ -80,9 +80,7 @@ "use strict"; | ||
}); | ||
const c = support_config_1.config().get('app', { | ||
port: 3000, | ||
hostname: '127.0.0.1' | ||
}); | ||
const port = support_config_1.config().get('app.port', 3000); | ||
const hostname = support_config_1.config().get('app.port', '0.0.0.0'); | ||
return new Promise(resolve => { | ||
server.listen(c.port, c.hostname, () => { | ||
support_winston_1.logger().info('app listening on %s:%s', c.hostname, c.port); | ||
server.listen(port, hostname, () => { | ||
support_winston_1.logger().info('app listening on %s:%s', hostname, port); | ||
resolve(server); | ||
@@ -89,0 +87,0 @@ }); |
{ | ||
"name": "@chainizer/support-app", | ||
"version": "1.0.0-alpha.38", | ||
"version": "1.0.0-alpha.50", | ||
"description": "App lifecycle management.", | ||
@@ -5,0 +5,0 @@ "author": "Thibault Morin", |
@@ -8,7 +8,2 @@ import {config} from '@chainizer/support-config'; | ||
export interface AppConfig { | ||
port: number | ||
hostname: string | ||
} | ||
export enum HookType { | ||
@@ -81,10 +76,8 @@ startup = 'startup', | ||
const c: AppConfig = config().get('app', { | ||
port: 3000, | ||
hostname: '127.0.0.1' | ||
}); | ||
const port = config().get('app.port', 3000); | ||
const hostname = config().get('app.port', '0.0.0.0'); | ||
return new Promise<Server>(resolve => { | ||
server.listen(c.port, c.hostname, () => { | ||
logger().info('app listening on %s:%s', c.hostname, c.port); | ||
server.listen(port, hostname, () => { | ||
logger().info('app listening on %s:%s', hostname, port); | ||
resolve(server); | ||
@@ -91,0 +84,0 @@ }); |
11426
238