From 8dfca4c986c811b9176e10f3aaebc3a460ebe7fc Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Sun, 4 Jun 2017 11:48:16 +0700 Subject: [PATCH] Update API docs --- README.md | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d584940..eb6ea38 100644 --- a/README.md +++ b/README.md @@ -132,26 +132,6 @@ express instance resolved from `createTestServer()` This is just a normal express instance with a few extra properties. -#### server.port - -Type: `number`, `undefined` - -The port the HTTP server is listening on. - -e.g: `5486` - -`undefined` while the server is not listening. - -#### server.sslPort - -Type: `number`, `undefined` - -The port the HTTPS server is listening on. - -e.g: `5487` - -`undefined` while the server is not listening. - #### server.url Type: `string`, `undefined` @@ -184,6 +164,8 @@ Type: `function` Returns a Promise that resolves when both the HTTP and HTTPS servers are listening. +Once the servers are listening, `server.url` and `server.sslUrl` will be updated. + Please note, this function doesn't take a port argument, it uses a new randomised port each time. Also, you don't need to manually call this after creating a server, it will start listening automatically. #### server.close() @@ -192,6 +174,8 @@ Type: `function` Returns a Promise that resolves when both the HTTP and HTTPS servers have stopped listening. +Once the servers have stopped listening, `server.url` and `server.sslUrl` will be set to `undefined`. + ## Related - [`create-cert`](https://github.com/lukechilds/create-cert) - Super simple self signed certificates