Unify the servers response

Đang mở
#27 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu bằng việc xem xét entry point create-servers và cách nó xử lý cấu hình máy chủ dưới dạng object so với array. Công việc được coi là hoàn tất khi đã thống nhất và triển khai một response signature cho cả hai chế độ, sau đó xác minh rằng các máy chủ được trả về nhất quán có khóa là địa chỉ hoặc được chuẩn hóa theo một cách khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 } 
}
Ngôn ngữ chính
JavaScript
Star
44
Fork
19
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của http-party/create-servers

Tất cả issue của http-party/create-servers

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.