trellis_shelf 0.9.0 copy "trellis_shelf: ^0.9.0" to clipboard
trellis_shelf: ^0.9.0 copied to clipboard

Shelf integration for the Trellis template engine — middleware, HTMX helpers, and security defaults.

example/example.dart

import 'package:shelf/shelf.dart';
import 'package:trellis/trellis.dart';
import 'package:trellis_shelf/trellis_shelf.dart';

void main() {
  final engine = Trellis(loader: MapLoader({'index.html': r'<h1 tl:text="${title}">Hello</h1>'}));

  final handler = const Pipeline()
      .addMiddleware(trellisSecurityHeaders())
      .addMiddleware(trellisEngine(engine))
      .addMiddleware(trellisCsrf(secret: 'dev-secret'))
      .addHandler((request) => renderPage(request, 'index.html', {'title': 'Hello Shelf'}));

  print(handler);
}
0
likes
0
points
261
downloads

Publisher

unverified uploader

Weekly Downloads

Shelf integration for the Trellis template engine — middleware, HTMX helpers, and security defaults.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, shelf, trellis

More

Packages that depend on trellis_shelf