Shelf is web server middleware for Dart that encourages composition and easy reuse.
Shelf makes it easy to create and compose web servers and parts of web servers.
A handler is any function that handles a shelf.Request and returns a shelf.Response. It can either handle the request itself–for example, a static file server that looks up the requested URI on the filesystem–or it can do some processing and forward it to another handler–for example, a logger that prints information about requests and responses to the command line.
The latter kind of handler is called “middleware”, since it sits in the middle of the server stack. Middleware can be thought of as a function that takes a handler and wraps it in another handler to provide additional functionality. A Shelf application is usually composed of many layers of middleware with one or more handlers at the very center; the shelf.Pipeline class makes this sort of application easy to construct.
Some middleware can also take multiple handlers and call one or more of them for each request. For example, a routing middleware might choose which handler to call based on the request’s URI or HTTP method, while a cascading middleware might call each one in sequence until one returns a successful response.
This is free and open source software.
Key Features
- 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.
Website: pub.dev/packages/shelf
Support: GitHub Code Repository
Developer: Dart Project Authors
License: BSD 3-Clause “New” or “Revised” License
Shelf is written in Dart. Learn Dart with our recommended free books and free tutorials.
Related Software
| Dart Web Frameworks | |
|---|---|
| Flutter | UI toolkit for building natively compiled applications |
| Jaspr | Modern web framework for building websites in Dart |
| Angel3 | Full-stack web framework that is build to streamline development |
| Dart Frog | Fast, minimalistic backend framework |
| Shelf | Web server middleware |
| Jaguar | Full-stack production ready HTTP server framework built to be fast and simple |
| Angular | Fast and productive web framework |
| Alfred | Performant expressjs like web server / rest api framework |
| Vania | Approachable development workflow with integrated tools |
| Vaden | Backend web framework |
| Start | Sinatra inspired web development framework |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.