Skip to content

フロントエンドのエンドポイントの設定方法を axios に統一する #1375

Closed
@1nu1taichi

Description

@1nu1taichi

概要

OpenAPI generator の更新により、エンドポイントの設定が apiClient だけでなく axios でもできるようになり、axiosの設定値が最も優先順位が高くなった。
OpenAPITools/openapi-generator#17296

そのため OpenAPI generator の有無にかかわらず axios でエンドポイントの設定ができるようになるため、axios に統一したい。

詳細

以下のように修正する。

/** api-client の共通の Configuration があればここに定義します。 */
function createConfig(): apiClient.Configuration {
  const config = new apiClient.Configuration({
-    basePath: import.meta.env.VITE_AXIOS_BASE_ENDPOINT_ORIGIN,
  });
  return config;
}

/** axios の共通の設定があればここに定義します。 */
const axiosInstance = axios.create({
+  baseURL: import.meta.env.VITE_AXIOS_BASE_ENDPOINT_ORIGIN,
  headers: {
    'Content-Type': 'application/json',
  },
  withCredentials: true,
});

影響範囲

完了条件

  • エンドポイントの設定が axios で行われている
    • Dressca
    • AzureADB2C
  • エンドポイントの設定に関するドキュメントが正しく更新されている

Metadata

Metadata

Assignees

Labels

target: Azure AD B2C AuthAzure AD B2C認証の要件別サンプルに関係があるtarget: DresscaサンプルアプリケーションDresscaに関係があるtarget: ガイド/AP開発手順ドキュメントのガイド/アプリケーション開発手順に関係がある

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions