Browse Source

Update API docs

pull/2/head
Luke Childs 8 years ago
parent
commit
8dfca4c986
  1. 24
      README.md

24
README.md

@ -132,26 +132,6 @@ express instance resolved from `createTestServer()`
This is just a normal express instance with a few extra properties. 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 #### server.url
Type: `string`, `undefined` Type: `string`, `undefined`
@ -184,6 +164,8 @@ Type: `function`
Returns a Promise that resolves when both the HTTP and HTTPS servers are listening. 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. 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() #### server.close()
@ -192,6 +174,8 @@ Type: `function`
Returns a Promise that resolves when both the HTTP and HTTPS servers have stopped listening. 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 ## Related
- [`create-cert`](https://github.com/lukechilds/create-cert) - Super simple self signed certificates - [`create-cert`](https://github.com/lukechilds/create-cert) - Super simple self signed certificates

Loading…
Cancel
Save