wait-for-localhost
Advanced tools
Comparing version
@@ -5,10 +5,19 @@ declare namespace waitForLocalhost { | ||
@default 80 | ||
*/ | ||
*/ | ||
port?: number; | ||
/** | ||
Use a custom path. | ||
For example, `/health` for a health-check endpoint. | ||
@default '/' | ||
*/ | ||
path?: string; | ||
/** | ||
Use the `GET` HTTP-method instead of `HEAD` to check if the server is running. | ||
@default false | ||
*/ | ||
*/ | ||
useGet?: boolean; | ||
@@ -15,0 +24,0 @@ } |
@@ -13,3 +13,3 @@ 'use strict'; | ||
const main = () => { | ||
const request = http.request({method, port: options.port}, response => { | ||
const request = http.request({method, port: options.port, path: options.path}, response => { | ||
if (response.statusCode === 200) { | ||
@@ -16,0 +16,0 @@ return resolve(); |
{ | ||
"name": "wait-for-localhost", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Wait for localhost to be ready", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -42,2 +42,11 @@ # wait-for-localhost [](https://travis-ci.org/sindresorhus/wait-for-localhost) | ||
##### path | ||
Type: `string`<br> | ||
Default: `'/'` | ||
Use a custom path. | ||
For example, `/health` for a health-check endpoint. | ||
##### useGet | ||
@@ -44,0 +53,0 @@ |
4611
6%63
10.53%68
15.25%