Unify the servers response

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

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

評価

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

調査の方向性

まず create-servers のエントリポイントと、サーバー設定をオブジェクトとして扱う場合と配列として扱う場合の処理を確認します。両方のモードに対して 1 つのレスポンスシグネチャに合意して実装し、返されるサーバーが一貫してアドレスをキーにしているか、または別の方法で正規化されていることを検証できれば完了です。

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

説明

create-servers allows you to configure a single http server using the object syntax or multiple http server instances using an array with objects where each object the configuration for each server. While that is a nice feature to have it comes with a really painful side effect and that is that the response signature of the module changes based on the configuration. When the servers are configured using just a single object to create a single server the servers response would be:

{
  http: { http server }
}

But when you are providing create-servers with an array of multiple configurations, the response signature magically changes to an array:

{
  http: [
    { http server 1 },
    { http server 2 }
  ]
}

So in order to handle both formats, implementers of this library need to support both cases, and normalise it into workable format for their library. What I like to propose instead is that the create-servers changes it's response signature to be consistent between both configuration modes (array and object).

One way of doing this would be to return an object that is keyed on the address of the server instead of separate distinction between http, https, and then the multiple or single server that is created. So in the case of multiple servers, there would simply be more keys in the object allowing the signature to be the same.

{
  80: { http server },
  8080: { http server },
  443: { http server } 
}
主要言語
JavaScript
スター
44
フォーク
19
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

http-party/create-servers のほかの issue

http-party/create-servers の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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