2024-10-13 01:45:27 +00:00
|
|
|
import 'package:protevus_framework/protevus_framework.dart';
|
|
|
|
import 'package:protevus_mustache/protevus_mustache.dart';
|
2018-11-08 15:56:00 +00:00
|
|
|
import 'package:file/file.dart';
|
|
|
|
import 'package:file/local.dart';
|
|
|
|
|
2021-06-20 12:37:20 +00:00
|
|
|
const FileSystem fs = LocalFileSystem();
|
2018-11-08 15:56:00 +00:00
|
|
|
|
2024-10-12 10:35:14 +00:00
|
|
|
void configureServer(Protevus app) async {
|
2018-11-08 15:56:00 +00:00
|
|
|
// 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'});
|
|
|
|
});
|
|
|
|
}
|