server-ready
Know when a server is ready to receive requests. Used in hotel.
Install
npm install server-ready --save
Example
var serverReady = var port = 3000 // A server process is spawned here or somewhere else...
How it works?
server-ready
will try to connect every 250ms
to the specified port
until a connection has been made or timeout has been reached (20s
by default).
API
serverReady.timeout
Default timeout.
serverReady(port[, host][, timeout], cb)
Tries to connect to port
.
License
MIT - Typicode