From 20de6cccf51321ef1971cc2a8f1bcf35217734e1 Mon Sep 17 00:00:00 2001 From: thosakwe Date: Mon, 19 Sep 2016 16:31:32 -0400 Subject: [PATCH] README --- README.md | 19 +++++++++++++++++-- pubspec.yaml | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1b4745b5..ca48aee6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Angel Configuration -YAML configuration loader for Angel. +Isomorphic YAML configuration loader for Angel. # About Any web app needs different configuration for development and production. This plugin will search @@ -18,6 +18,8 @@ dependencies: # Usage +**Server-side** + ```dart import 'dart:io'; import 'package:angel_framework/angel_framework.dart'; @@ -25,10 +27,23 @@ import 'package:angel_configuration/angel_configuration.dart'; main() async { Angel angel = new Angel(); - angel.configure(loadConfigurationFile()); // It's that easy + angel.configure(loadConfigurationFile()); // It's that easy! } ``` `loadConfigurationFile` also accepts a `sourceDirectory` or `overrideEnvironmentName` parameter. The former will allow you to search in a directory other than `config`, and the latter lets you override `$ANGEL_ENV` by specifying a specific configuration name to look for (i.e. 'production'). + +**In the Browser** + +You can easily load configuration values within your client-side app, +and they will be automatically replaced by a Barback transformer. + +```dart +import 'package:angel_configuration/browser.dart'; + +main() async { + print(config("some_key.other.nested_key")); +} +``` diff --git a/pubspec.yaml b/pubspec.yaml index 5ed37d7a..8692aaef 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_configuration -description: YAML configuration loader for Angel. +description: Isomorphic YAML configuration loader for Angel. version: 1.0.1+1 author: thosakwe homepage: https://github.com/angel-dart/angel_configuration