|
| 1 | +/* |
| 2 | +Copyright 2019 Iguazio Systems Ltd. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License") with |
| 5 | +an addition restriction as set forth herein. You may not use this |
| 6 | +file except in compliance with the License. You may obtain a copy of |
| 7 | +the License at http://www.apache.org/licenses/LICENSE-2.0. |
| 8 | +
|
| 9 | +Unless required by applicable law or agreed to in writing, software |
| 10 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 12 | +implied. See the License for the specific language governing |
| 13 | +permissions and limitations under the License. |
| 14 | +
|
| 15 | +In addition, you may not use the software for any purposes that are |
| 16 | +illegal under applicable law, and the grant of the foregoing license |
| 17 | +under the Apache 2.0 license is conditioned upon your compliance with |
| 18 | +such restriction. |
| 19 | +*/ |
| 20 | + |
| 21 | +export const mlrunProxyConfig = env => ({ |
| 22 | + '/api': env.VITE_MLRUN_API_URL |
| 23 | + ? { |
| 24 | + target: env.VITE_MLRUN_API_URL, |
| 25 | + changeOrigin: true, |
| 26 | + headers: { |
| 27 | + Connection: 'keep-alive', |
| 28 | + 'x-v3io-session-key': env.VITE_MLRUN_V3IO_ACCESS_KEY, |
| 29 | + 'x-remote-user': 'admin' |
| 30 | + } |
| 31 | + } |
| 32 | + : undefined, |
| 33 | + '/nuclio': env.VITE_NUCLIO_API_URL |
| 34 | + ? { |
| 35 | + target: env.VITE_NUCLIO_API_URL, |
| 36 | + changeOrigin: true, |
| 37 | + rewrite: path => path.replace(/^\/nuclio/, '') |
| 38 | + } |
| 39 | + : undefined, |
| 40 | + '/iguazio': env.VITE_IGUAZIO_API_URL |
| 41 | + ? { |
| 42 | + target: env.VITE_IGUAZIO_API_URL, |
| 43 | + changeOrigin: true, |
| 44 | + rewrite: path => path.replace(/^\/iguazio/, '') |
| 45 | + } |
| 46 | + : undefined, |
| 47 | + '/function-catalog': env.VITE_FUNCTION_CATALOG_URL |
| 48 | + ? { |
| 49 | + target: env.VITE_FUNCTION_CATALOG_URL, |
| 50 | + changeOrigin: true, |
| 51 | + rewrite: path => path.replace(/^\/function-catalog/, '') |
| 52 | + } |
| 53 | + : undefined |
| 54 | +}) |
| 55 | + |
| 56 | +void ['mlrunProxyConfig', 'rewrite'] |
0 commit comments