@@ -81,8 +81,10 @@ async function run() {
8181 let wsUrl : string | undefined ;
8282 if ( options . ws ) {
8383 wsUrl = options . ws ;
84- } else {
85- if ( cdkOutput && cdkOutput [ Object . keys ( cdkOutput ) [ 0 ] ] ) {
84+ } else if ( cdkOutput ) {
85+ if ( cdkOutput [ options . cdkstack ] ) {
86+ wsUrl = cdkOutput [ options . cdkstack ] . ServerlessSpyWsUrl ;
87+ } else if ( cdkOutput [ Object . keys ( cdkOutput ) [ 0 ] ] ) {
8688 wsUrl = cdkOutput [ Object . keys ( cdkOutput ) [ 0 ] ] . ServerlessSpyWsUrl ;
8789 }
8890 }
@@ -174,13 +176,7 @@ async function run() {
174176
175177 if ( request . url === '/stackList' ) {
176178 response . writeHead ( 200 , { 'Content-Type' : 'application/json' } ) ;
177-
178- const stackListAvailable : string [ ] | undefined =
179- options . cdkstack && stackList ?. includes ( options . cdkstack )
180- ? [ options . cdkstack ]
181- : stackList ;
182-
183- response . end ( JSON . stringify ( stackListAvailable ) , 'utf-8' ) ;
179+ response . end ( JSON . stringify ( stackList ) , 'utf-8' ) ;
184180 } else if ( request . url ?. match ( '^/wsUrl' ) ) {
185181 response . writeHead ( 200 , { 'Content-Type' : 'text/html' } ) ;
186182 response . end ( `ws:localhost:${ options . wsport } ` , 'utf-8' ) ;
@@ -212,7 +208,7 @@ async function run() {
212208 . listen ( options . port ) ;
213209
214210 console . log (
215- `ServerlessSoy console runing at http://localhost:${ options . port } `
211+ `ServerlessSpy console runing at http://localhost:${ options . port } `
216212 ) ;
217213 if ( options . open ) {
218214 await opener ( `http://localhost:${ options . port } ` ) ;
0 commit comments