stagecoach
Shuffle servers around to make staging instances super simple for continuous integration and load balancing.
examples
forward.js
Spin up 2 http servers and forward localhost:8000 to :9000 and $(hostname):8000 to :9001.
var stagecoach = ;var exec = exec;var http = ; http; http; ;
swap.js
Spin up 2 servers and swap the servers every 2 seconds between sitting at localhost:8000 and $(hostname):8000.
var stagecoach = ;var exec = exec;var http = ; http; http; ;
methods
var stagecoach = ;var coach = ;
coach.listen(port)
Listen on a port.
coach.add(from, to)
Map the hostname string from
to the host, port, "host:port", or
{ host : ..., port : ... }
value to
.
Incoming requests for the hostname from
will be forwarded to to
.
Incoming from
hostnames will have any ":port" values stripped out.
coach.swap(x, y)
Swap the routes for hostnames x
and y
.
todo
- hooks for load-balancing (an array or callback for .add()'s
to
)
install
With npm do:
npm install stagecoach
license
MIT/X11