@@ -61,12 +61,19 @@ const setupProxy = (dcl: any, app: express.Application) => {
61
61
}
62
62
63
63
createStaticRoutes ( app , '/images/decentraland-connect/*' , dclKernelImagesDecentralandConnect )
64
- createStaticRoutes ( app , '/@/artifacts/unity-renderer/*' , dclUnityRenderer )
64
+ createStaticRoutes ( app , '/@/artifacts/unity-renderer/*' , dclUnityRenderer , ( filePath ) =>
65
+ filePath . replace ( / .b r + $ / , '' )
66
+ )
65
67
createStaticRoutes ( app , '/@/artifacts/loader/*' , dclKernelLoaderPath )
66
68
createStaticRoutes ( app , '/default-profile/*' , dclKernelDefaultProfilePath )
67
69
}
68
70
69
- const createStaticRoutes = ( app : express . Application , route : string , localFolder : string ) => {
71
+ const createStaticRoutes = (
72
+ app : express . Application ,
73
+ route : string ,
74
+ localFolder : string ,
75
+ mapFile ?: ( ( filePath : string ) => string )
76
+ ) => {
70
77
app . use ( route , ( req , res , next ) => {
71
78
const options = {
72
79
root : localFolder ,
@@ -82,7 +89,7 @@ const createStaticRoutes = (app: express.Application, route: string, localFolder
82
89
}
83
90
}
84
91
85
- const fileName = req . params [ 0 ]
92
+ const fileName : string = mapFile ? mapFile ( req . params [ 0 ] ) : req . params [ 0 ]
86
93
87
94
res . sendFile ( fileName , options , ( err ) => {
88
95
if ( err ) {
0 commit comments