web_server library
Classes
- AbstractWidget
- Deprecated alias for WebWidget. AbstractWidget was the base class for all widgets in the old API.
- JsonWidget
- A WebWidget that renders JSON output. The output will be the result of passing the provided object to jsonEncode.
- ListWidget
- Combines a List of WebWidgets into a single WebWidget.
- PathCacheMaxAge
- A path pattern to match, and the max age that paths that match the pattern should be cached for, in seconds.
- RedirectWidget
- A WebWidget that renders a HTTP redirect to the provided url.
- Route
- A Route defines a destination in Serverpod's web server. It will handle a call and generate an appropriate response by manipulating the Request object. You override Route, or more likely it's subclass WidgetRoute to create your own custom routes in your server.
- RouteStaticDirectory
- Route for serving a directory of static files.
- Templates
- Loads and caches templates.
- TemplateWidget
-
A WebWidget based on a HTML template. The name of the template should
correspond to a template file in your server's web/templates directory.
Set the custom values of the template by populating the values field. If
values are set that aren't Strings, the
toString
method will be called on the value. The templates are loaded when the server starts. If you add new templates or modify existing templates, you will need to restart the server for them to take effect. - WebServer
- The Serverpod webserver.
- WebWidget
- The base class for all web widgets. Override this class to create a custom widget type, or use one of the default types which covers most common use cases.
- Widget
- Deprecated alias for TemplateWidget. The base Widget class has been renamed to TemplateWidget for clarity.
- WidgetJson
- Deprecated alias for JsonWidget. WidgetJson has been renamed to JsonWidget for consistency.
- WidgetList
- Deprecated alias for ListWidget. WidgetList has been renamed to ListWidget for consistency.
- WidgetRedirect
- Deprecated alias for RedirectWidget. WidgetRedirect has been renamed to RedirectWidget for consistency.
- WidgetRoute
- A WidgetRoute is the most convenient way to create routes in your server. Override the build method and return an appropriate WebWidget.
Enums
- RouteMethod
- Defines HTTP call methods for routes.
Extension Types
- ServerpodRouter
-
A ServerpodRouter is a collection of Routes that can be used to
handle incoming requests. It uses the
relic
package to match routes.