protevus/lib/src/config/config.dart

34 lines
1.2 KiB
Dart
Raw Normal View History

2016-04-22 02:56:21 +00:00
/// Configuration for this Angel instance.
2017-10-19 21:53:33 +00:00
library angel.src.config;
2016-04-22 02:56:21 +00:00
2017-10-19 21:53:33 +00:00
import 'package:angel_configuration/angel_configuration.dart';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_jael/angel_jael.dart';
import 'package:file/file.dart';
2016-12-10 18:51:02 +00:00
import 'plugins/plugins.dart' as plugins;
2016-04-22 02:56:21 +00:00
2016-06-23 21:54:10 +00:00
/// This is a perfect place to include configuration and load plug-ins.
2017-10-19 21:53:33 +00:00
AngelConfigurer configureServer(FileSystem fileSystem) {
return (Angel app) async {
// Load configuration from the `config/` directory.
//
// See: https://github.com/angel-dart/configuration
await app.configure(configuration(fileSystem));
2016-12-24 18:32:47 +00:00
2017-10-19 21:53:33 +00:00
// Configure our application to render Jael templates from the `views/` directory.
//
// See: https://github.com/angel-dart/jael
await app.configure(jael(fileSystem.directory('views')));
2017-01-01 08:03:22 +00:00
2017-10-19 21:53:33 +00:00
// Apply another plug-ins, i.e. ones that *you* have written.
//
// Typically, the plugins in `lib/src/config/plugins/plugins.dart` are plug-ins
// that add functionality specific to your application.
//
// If you write a plug-in that you plan to use again, or are
// using one created by the community, include it in
// `lib/src/config/config.dart`.
await plugins.configureServer(app);
};
2016-06-23 21:54:10 +00:00
}