Support for starting and stopping multiple servers in the same PS session
Closed this issue · 1 comments
TylerLeonhardt commented
We should be able to do:
$app1 = Start-Polaris -Port 8080
New-Polaris
$app2 = Start-Polaris -Port 8081
Stop-Polaris $app2
Stop-Polaris $app1
Where New-Polaris
creates a new Polaris object and puts it in the existing global $Polaris
variable.
This also means that all New-*Route
cmdlets should allow a -ServerContext
param where you can pass in the server you want to add a route to.
Example:
$app = Start-Polaris -Port 8080
$sb = { $response.Send("atlas") }
New-GetRoute /hello $sb -ServerContext $app
This is actually almost done. Work remaining is:
- create the
New-Polaris
cmdlet that creates a new Polaris object and stores it in$global:Polaris
- add
-ServerContext
toNew-*Route
TylerLeonhardt commented
This is possible now.