@@ -81,8 +81,10 @@ async function run() {
81
81
let wsUrl : string | undefined ;
82
82
if ( options . ws ) {
83
83
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 ] ] ) {
86
88
wsUrl = cdkOutput [ Object . keys ( cdkOutput ) [ 0 ] ] . ServerlessSpyWsUrl ;
87
89
}
88
90
}
@@ -174,13 +176,7 @@ async function run() {
174
176
175
177
if ( request . url === '/stackList' ) {
176
178
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' ) ;
184
180
} else if ( request . url ?. match ( '^/wsUrl' ) ) {
185
181
response . writeHead ( 200 , { 'Content-Type' : 'text/html' } ) ;
186
182
response . end ( `ws:localhost:${ options . wsport } ` , 'utf-8' ) ;
@@ -212,7 +208,7 @@ async function run() {
212
208
. listen ( options . port ) ;
213
209
214
210
console . log (
215
- `ServerlessSoy console runing at http://localhost:${ options . port } `
211
+ `ServerlessSpy console runing at http://localhost:${ options . port } `
216
212
) ;
217
213
if ( options . open ) {
218
214
await opener ( `http://localhost:${ options . port } ` ) ;
0 commit comments