搜尋套件、儲存庫與 APP 分類

套件詳情v1.4.3

shelf

一個用於 Web 伺服器中間件的模型,鼓勵組合與輕鬆重用。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1570萬
喜歡數
1050
Pub 分數
160

安裝套件

flutter pub add shelf

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Shelf 是一個 Dart 套件,提供輕量級、模組化的框架,用於建立 Web 伺服器與中介軟體。它強調組合性,讓開發者能透過簡單、函數式的 API 建立彈性且可重複使用的伺服器邏輯。中介軟體元件可以串連起來,有效處理請求與回應,非常適合小型服務與複雜的後端系統。Shelf 設計時著重於簡潔性與相容性,可無縫整合至 Dart 生態系,並支援多個平台,包括 Web、行動裝置與桌面。

適用情境

  • 建構 REST API
  • 建立自訂Web伺服器
  • 實現請求/響應中間件
  • 開發微服務
  • 處理 HTTP 路由和驗證

主要特色

  • 模組化中介軟體架構
  • 易於組合的請求處理程式
  • 跨平台支援
  • 輕量且開銷極小
  • 內建對串流和非同步作業的支援

適合對象

  • 後端開發人員
  • API 創建者
  • 基於 Dart 的 Web 服務建構器
  • 微服務架構師
  • 學習 HTTP 伺服器概念

使用建議

  • 不是完整的 Web 框架(需要額外的套件來實現路由)
  • 與更大的框架相比,內建功能有限
  • 需要手動設定才能啟用進階功能

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Build Status

About Shelf

Shelf makes it easy to create and compose web servers and parts of web servers. How?

  • Expose a small set of simple types.
  • Map server logic into a simple function: a single argument for the request, the response is the return value.
  • Trivially mix and match synchronous and asynchronous processing.
  • Flexibility to return a simple string or a byte stream with the same model.

It was inspired by Connect for NodeJS and Rack for Ruby.

See the package:shelf readme for more information.

Packages

Package Description Issues Version
shelf A model for web server middleware that encourages composition and easy reuse. issues pub package
shelf_packages_handler A shelf handler for serving a packages/ directory. issues pub package
shelf_proxy A shelf handler for proxying HTTP requests to another server. issues pub package
shelf_router A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations. issues pub package
shelf_router_generator A package:build-compatible builder for generating request routers for the shelf web-framework based on source annotations. issues pub package
shelf_static Static file server support for the shelf package and ecosystem. issues pub package
shelf_test_handler A Shelf handler that makes it easy to test HTTP interactions. issues pub package
shelf_web_socket A shelf handler that wires up a listener for every connection. issues pub package
_shelf_compliance HTTP/1.1 compliance and hardening tests. issues (not published)

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

所屬分類

依賴

依賴清單 6 項

原始碼儲存庫

使用此套件的專案

所在榜單