@adonisjs/ignitor
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -0,1 +1,12 @@ | ||
<a name="1.0.8"></a> | ||
## [1.0.8](https://github.com/adonisjs/adonis-ignitor/compare/v1.0.7...v1.0.8) (2017-08-22) | ||
### Features | ||
* **resolver:** add validators dir to the map ([04deced](https://github.com/adonisjs/adonis-ignitor/commit/04deced)) | ||
* **server:** auto discover port when default one is empty ([aab9923](https://github.com/adonisjs/adonis-ignitor/commit/aab9923)) | ||
<a name="1.0.7"></a> | ||
@@ -2,0 +13,0 @@ ## [1.0.7](https://github.com/adonisjs/adonis-ignitor/compare/v1.0.6...v1.0.7) (2017-08-18) |
{ | ||
"name": "@adonisjs/ignitor", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Fire the adonis-app (in good sense)", | ||
@@ -47,2 +47,3 @@ "main": "index.js", | ||
"debug": "^2.6.8", | ||
"get-port": "^3.2.0", | ||
"pify": "^3.0.0" | ||
@@ -49,0 +50,0 @@ }, |
@@ -13,2 +13,3 @@ 'use strict' | ||
const debug = require('debug')('adonis:ignitor') | ||
const getPort = require('get-port') | ||
const path = require('path') | ||
@@ -33,3 +34,4 @@ const Helpers = require('../Helpers') | ||
middleware: 'Middleware', | ||
commands: 'Commands' | ||
commands: 'Commands', | ||
validators: 'Validators' | ||
} | ||
@@ -385,2 +387,3 @@ | ||
* @method _startHttpServer | ||
* @async | ||
* | ||
@@ -391,3 +394,3 @@ * @return {void} | ||
*/ | ||
_startHttpServer (customHttpInstance) { | ||
async _startHttpServer (customHttpInstance) { | ||
this._callHooks('before', 'httpServer') | ||
@@ -406,4 +409,18 @@ | ||
Server.listen(Env.get('HOST'), Env.get('PORT')) | ||
this._callHooks('after', 'httpServer') | ||
const host = Env.get('HOST') | ||
/** | ||
* Search for an available port when the default | ||
* one is busy. But only in development | ||
* | ||
* @type {Number} | ||
*/ | ||
const port = Env.get('NODE_ENV') === 'development' | ||
? await getPort({ port: Env.get('PORT'), host }) | ||
: Env.get('PORT') | ||
/** | ||
* Start the server | ||
*/ | ||
Server.listen(host, port, () => (this._callHooks('after', 'httpServer'))) | ||
} | ||
@@ -567,3 +584,3 @@ | ||
await this.fire() | ||
this._startHttpServer() | ||
await this._startHttpServer() | ||
} | ||
@@ -570,0 +587,0 @@ |
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
30250
878
3
+ Addedget-port@^3.2.0
+ Addedget-port@3.2.0(transitive)