Route json assets based on the BASE_MODULE
This commit is contained in:
		
							parent
							
								
									8bc0a4d873
								
							
						
					
					
						commit
						12b3246404
					
				@ -15,7 +15,6 @@ try {
 | 
			
		||||
      throw new Error(e);
 | 
			
		||||
  } else {
 | 
			
		||||
      console.log(`${CONFIG_FILE_NAME} file not found, using default config`);
 | 
			
		||||
      
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -61,4 +60,20 @@ PROXY_CONFIG = [
 | 
			
		||||
    }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
if (configContent && configContent.BASE_MODULE == "liquid") {
 | 
			
		||||
    PROXY_CONFIG.push({
 | 
			
		||||
        context: ['/resources/pools.json', '/resources/assets.json', '/resources/assets.minimal.json'],
 | 
			
		||||
        target: "https://liquid.network",
 | 
			
		||||
        secure: false,
 | 
			
		||||
        changeOrigin: true,
 | 
			
		||||
    });
 | 
			
		||||
} else {
 | 
			
		||||
    PROXY_CONFIG.push(   {
 | 
			
		||||
        context: ['/resources/pools.json', '/resources/assets.json', '/resources/assets.minimal.json'],
 | 
			
		||||
        target: "https://mempool.space",
 | 
			
		||||
        secure: false,
 | 
			
		||||
        changeOrigin: true,
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = PROXY_CONFIG;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user