platform/packages/mustache/example/main.dart
Tobe O c94bec26ec Add 'packages/mustache/' from commit 'd0335a925d7199f3a5988ca10da36fee38ce0c43'
git-subtree-dir: packages/mustache
git-subtree-mainline: 9458a72c57
git-subtree-split: d0335a925d
2020-02-15 18:29:03 -05:00

16 lines
458 B
Dart

import 'package:angel_framework/angel_framework.dart';
import 'package:angel_mustache/angel_mustache.dart';
import 'package:file/file.dart';
import 'package:file/local.dart';
const FileSystem fs = const LocalFileSystem();
configureServer(Angel app) async {
// Run the plug-in
await app.configure(mustache(fs.directory('views')));
// Render `hello.mustache`
app.get('/', (req, res) async {
await res.render('hello', {'name': 'world'});
});
}