6.2. ホストされた JSON ファイルを使用して Learning Paths をカスタマイズする
使いやすさとシンプルさを実現するために、ホストされた JSON ファイルを使用して Learning Paths を設定できます。
手順
- Learning Paths データを含む JSON ファイルを GitHub や Gitlab などの Web サーバーに公開します。サンプルは、https://raw.githubusercontent.com/redhat-developer/rhdh/release-1.6/packages/app/public/learning-paths/data.json を参照してください。
app-config.yamlファイルに以下を追加して、ホストされている JSON ファイルから Learning Paths データにアクセスするように Developer Hub プロキシーを設定します。proxy: endpoints: '/developer-hub': target: <target> pathRewrite: '^/api/proxy/developer-hub/learning-paths': '<learning_path.json>' changeOrigin: true secure: true<target>-
ホストされている JSON ファイルのベース URL (例:
https://raw.githubusercontent.com) を入力します。 <learning_path.json>ベース URL なしでホストされている JSON ファイルのパスを入力します (例:
'/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json')。ヒントHome ページも設定する場合は、
learning-pathとhomepageクイックアクセスプロキシーの両方で重複するpathRewritesを使用するため、learning-paths設定 (^api/proxy/developer-hub/learning-paths) を作成してから、homepage設定 (^/api/proxy/developer-hub) を作成します。以下に例を示します。proxy: endpoints: '/developer-hub': target: https://raw.githubusercontent.com/ pathRewrite: '^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json' '^/api/proxy/developer-hub/tech-radar': '/redhat-developer/rhdh/main/packages/app/public/tech-radar/data-default.json' '^/api/proxy/developer-hub': '/redhat-developer/rhdh/main/packages/app/public/homepage/data.json' changeOrigin: true secure: true