File tree Expand file tree Collapse file tree
packages/@dcl/sdk-commands/src/commands/start/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,6 +137,25 @@ export async function setupEcs6Endpoints(
137137 return res
138138 } )
139139
140+ router . all ( '/explorer/:path+' , async ( ctx ) => {
141+ const u = new URL ( ctx . url . toString ( ) )
142+ u . host = catalystUrl . host
143+ u . protocol = catalystUrl . protocol
144+ u . port = catalystUrl . port
145+ const req = await fetch ( u . toString ( ) , {
146+ headers : { connection : 'close' } ,
147+ method : ctx . request . method ,
148+ body : ctx . request . method === 'get' ? undefined : ctx . request . body
149+ } )
150+
151+ return {
152+ headers : {
153+ 'content-type' : req . headers . get ( 'content-type' ) || 'application/json'
154+ } ,
155+ body : req . body
156+ }
157+ } )
158+
140159 serveStatic ( components , workspace , router )
141160
142161 // TODO: get workspace scenes & wearables...
You can’t perform that action at this time.
0 commit comments