talira

shelf (Dart)

Web server middleware for Dart

open sourceBSD-3-Clausefree

shelf is the Dart team's web server middleware library: a server is a handler function that takes a request and returns a response, and middleware wraps handlers to add logging, routing, compression and the like, composed with a Pipeline. It mixes synchronous and asynchronous processing and returns a string or a byte stream with the same model. The same repository holds the packages built on it, such as shelf_router for routing, shelf_static for serving files, shelf_proxy and shelf_web_socket. It's BSD-3-Clause licensed and published on pub.dev by the Dart team.

Problems it solves

  • write a small HTTP server or API in Dart
  • add logging or routing middleware to a Dart web server
  • serve static files from a Dart backend

Features

  • handlers and composable middleware joined with a Pipeline
  • synchronous and asynchronous handlers with the same model
  • shelf_router for routing requests to handlers
  • shelf_static for serving static files
  • shelf_proxy and shelf_web_socket in the same repository

Alternatives

The same job

These do what shelf (Dart) does.

  1. Serverpod The ultimate backend for Flutter
  2. Dart Frog A fast, minimalistic backend framework for Dart

Compare shelf (Dart) with the top 3