Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

feat: Custom Server Routes for external backend api

オープン
#885 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
nuxt, typescript

調査の方向性

まず、提案されている /server/external/api.ts エントリーポイントと、既存の Nuxt サーバールートの設定方法を調査します。defineExternalApi、runtimeConfig.apiBase、ルートメソッド、ヘッダー、クエリ、Cookie がどのように組み合わさるかを確認します。リクエストごとに個別のサーバールートを用意せず、DevTools で外部 API を割り当ててテストできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement
🆒 Your use case

Server routes are amazing for testing api routes quickly but in a lot of use cases we could be using an external backend and we want to be able to assign them and test them directly in the devtools.

🆕 The solution you'd like

A method in the /server directory to assign external api routes with the sole purpose to assign external apis, my suggestion is /server/external/api.ts where we can modify the external backend settings directly inside this file:


export default defineExternalApi((event) => {
  const runtimeConfig = useRuntimeConfig()
  event.baseUrl = runtimeConfig.apiBase

  return {
    '/login': {
      method: 'POST',
      headers: [...], // these are defaults that are modifiable
      queries: [...],
      cookies: [...]
    },
    '/logout': {
      method: 'GET',
      ...
    }
  }
})


for compatibility we could build a tool to convert directly from postman or .rest files etc.

🔍 Alternatives you've considered

Implementing a nuxt server route for every single request and routing everything through it but it's absolutely not efficient.

ℹ️ Additional info

I believe this will heavily improve the development experience across teams and if some documentation was able to be implemented directly into them too it would mean that any api service can build with whatever accepted format and plug the documentation directly into nuxt which would make it such a powerful tool for teams and individuals.

主要言語
TypeScript
スター
3.3k
フォーク
214
平均マージ
19時間 45分
マージ済み PR(30日)
12

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nuxt/devtools のほかの issue

nuxt/devtools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。