搜索插件、代码仓与 APP 分类

插件详情v1.1.5

shelf_router

一个方便的 shelf web 框架请求路由器,支持 URL 参数、嵌套路由器以及通过源代码注解生成的路由器。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
61.5万
喜欢数
324
Pub 分数
160

安装插件

flutter pub add shelf_router

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Shelf Router 是一个轻量级、表达性强的路由库,专为 Shelf Web 框架设计,使开发者能够通过支持 URL 参数、嵌套路由以及通过源代码注解实现编译时路由生成的方式来定义 HTTP 路由。它通过简洁的语法和更好的组织结构,简化了请求处理。非常适合在跨多平台的 Dart 应用中构建可扩展的后端服务。

适合场景

  • 构建 RESTful API
  • 处理动态 URL 路由
  • 创建模块化后端服务
  • 从注释生成路由
  • 与基于书架的服务器集成

主要特点

  • URL 参数支持
  • 嵌套路由器组合
  • 基于源注释的路由生成
  • 干净、可读的路由定义
  • 与 Shelf 的无缝集成

适合对象

  • Dart 后端开发人员
  • API服务构建器
  • 跨平台服务器应用
  • 货架框架用户
  • 需要结构化路由的项目

使用建议

  • 需要 Shelf 框架
  • 仅限 Dart 服务器环境
  • 注解处理需要构建步骤
  • 不适用于客户端路由
  • 依赖于 build_runner 进行代码生成

原始 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.

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

所在榜单