File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 11import { Router } from 'express' ;
2- import memoizee from 'memoizee' ;
32
43import { EnvVars } from '../config' ;
54
@@ -9,18 +8,14 @@ export const addTempleAdsRedirection = (
98 isMisesVariable : boolean ,
109 templeAdsPathMainPart = path
1110) => {
12- const getRedirectionUrl = memoizee (
13- ( extVersion : string , isMisesBrowser : boolean ) =>
14- `${ EnvVars . TEMPLE_ADS_API_URL } /v1/api/ads-rules/${ extVersion } ${ templeAdsPathMainPart } ${
15- isMisesVariable ? ( isMisesBrowser ? '/mises' : '/no-mises' ) : ''
16- } `,
17- { max : 1000 , normalizer : args => JSON . stringify ( args ) }
18- ) ;
19-
2011 router . get ( path , ( req , res ) => {
2112 const { extVersion : rawExtVersion , isMisesBrowser : rawIsMisesBrowser } = req . query ;
2213 const extVersion = typeof rawExtVersion === 'string' ? rawExtVersion : '0.0.0' ;
2314 const isMisesBrowser = rawIsMisesBrowser === 'true' ;
24- res . redirect ( getRedirectionUrl ( extVersion , isMisesBrowser ) ) ;
15+ res . redirect (
16+ `${ EnvVars . TEMPLE_ADS_API_URL } /v1/api/ads-rules/${ extVersion } ${ templeAdsPathMainPart } ${
17+ isMisesVariable ? ( isMisesBrowser ? '/mises' : '/no-mises' ) : ''
18+ } `
19+ ) ;
2520 } ) ;
2621} ;
You can’t perform that action at this time.
0 commit comments