Skip to content

APIリクエスト方法を直接$fetchを叩くように修正#31

Merged
Shade4827 merged 1 commit intomainfrom
fix_api_request
Mar 26, 2026
Merged

APIリクエスト方法を直接$fetchを叩くように修正#31
Shade4827 merged 1 commit intomainfrom
fix_api_request

Conversation

@Shade4827
Copy link
Copy Markdown
Owner

課題

  • JSONを変更しても全く同じ内容しか取得できない
    • キャッシュによって現状のものを取得できない状態

やったこと

  • server/apiを削除
  • $fetchをラップしたcomposablesを追加し、baseURLを設定
  • JSON取得時にクエリパラメータを設定し、キャッシュ対策

Comment thread nuxt/nuxt.config.ts
import tailwindcss from '@tailwindcss/vite'

const siteUrl = process.env.NUXT_PUBLIC_SITE_URL || 'https://slides.shade4827.net'
const siteUrl = process.env.NUXT_PUBLIC_SITE_URL || 'http://localhost:3000/'
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localで叩けないのでlocalhostにした方が良い

@Shade4827 Shade4827 merged commit 54634e5 into main Mar 26, 2026
1 check passed
@Shade4827 Shade4827 deleted the fix_api_request branch March 26, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant