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

插件详情v1.2.0

shelf_static

shelf 包及生态系统的静态文件服务器支持。

AndroidiOSmacOSWindowsLinux
近 30 天下载
1450万
喜欢数
98
Pub 分数
160

安装插件

flutter pub add shelf_static

插件介绍

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

Shelf Static 是一个 Dart 包,为 Shelf Web 服务器框架提供静态文件服务功能。它使开发者能够从指定目录中提供 HTML、CSS、JavaScript 和图片等静态资源,非常适合托管简单的 Web 应用程序或在动态 API 旁边提供前端资源。基于 Shelf 生态系统构建,它可与其它 Shelf 中间件和处理器无缝集成。该包支持高效的文件缓存、内容类型检测以及可选的目录列表功能。

适合场景

  • 提供静态前端文件
  • 托管简单网站
  • 为API提供资产交付
  • 启用本地开发服务器
  • 支持混合应用后端

主要特点

  • 与 Shelf 的轻松集成
  • 自动内容类型检测
  • 目录列表支持
  • 文件缓存以提高性能
  • 可配置的根目录

适合对象

  • 使用 Shelf 的 Web 开发人员
  • 全栈 Dart 应用程序
  • 本地开发环境
  • 简单 API + 静态网站设置
  • 需要文件服务的后端服务

使用建议

  • 不建议大规模生产使用
  • 需要手动安全配置
  • 有限的高级功能,如压缩
  • 无内置认证
  • 最适合中小型静态文件需求

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

所属分类

依赖

依赖清单 5 项

源码仓库

使用此插件的项目

所在榜单