Skip to main content
Archery combines a Blade-style TemplateEngine with a guarded static file server; you will render dynamic HTML and deliver assets from the public directory.

Render a view

Call request.view() with a dot-separated template name and optional data. The engine loads templates from lib/src/http/views, where dashboard.index maps to dashboard/index.html.
lib/src/http/routes/web.dart
The engine supports escaped {{ value }} interpolation, raw {!! value !!} interpolation, @extends, @section, @yield, @include, @foreach, @if, @else, and @csrf.
lib/src/http/views/profile.html
Raw interpolation does not escape HTML. Use {!! value !!} only for content you already trust or sanitize.

Serve static files

Resolve StaticFilesServer from the application and call tryServe() before kernel dispatch. The default root is lib/src/http/public.
bin/server.dart
The server handles MIME types, Last-Modified, If-Modified-Since, byte ranges, HEAD, and path sanitization. It serves only GET and HEAD requests and returns false when no asset matches.
Set TemplateEngine.shouldCache to false during template development, and call clearCache() when you need to invalidate compiled content explicitly.