From b5d83e0a218e08b03246616acd967b317b274df0 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 8 Nov 2018 10:56:00 -0500 Subject: [PATCH] example --- .gitignore | 3 ++- CHANGELOG.md | 2 ++ README.md | 2 +- example/main.dart | 16 ++++++++++++++++ pubspec.yaml | 14 +++++++------- 5 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 example/main.dart diff --git a/.gitignore b/.gitignore index f47e7629..670f6708 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ doc/api/ # (Library packages only! Remove pattern if developing an application package) pubspec.lock -.idea \ No newline at end of file +.idea +.dart_tool \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..cde505dc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +# 2.0.0 +* Angel 2 and Dart 2 support. \ No newline at end of file diff --git a/README.md b/README.md index afe4027b..8cb38563 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ In `pubspec.yaml`: ```yaml dependencies: - angel_mustache: ^1.1.0 + angel_mustache: ^2.0.0 ``` # Usage diff --git a/example/main.dart b/example/main.dart new file mode 100644 index 00000000..30467e60 --- /dev/null +++ b/example/main.dart @@ -0,0 +1,16 @@ +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'}); + }); +} diff --git a/pubspec.yaml b/pubspec.yaml index c4b417d7..45c95a93 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,13 +2,13 @@ name: angel_mustache description: Mustache view generator for Angel. author: thosakwe homepage: https://github.com/angel-dart/angel_mustache -version: 1.1.0 +version: 2.0.0 environment: - sdk: ">=1.19.0" + sdk: ">=2.0.0-dev <3.0.0" dependencies: - angel_framework: "^1.1.0-alpha" - file: ^2.0.0 - mustache4dart: ">= 1.0.0 < 2.0.0" + angel_framework: ^2.0.0-alpha + file: ^5.0.0 + mustache4dart: ^3.0.0-dev dev_dependencies: - http: ">= 0.11.3 < 0.12.0" - test: ">= 0.12.13 < 0.13.0" + http: + test: