2016-04-22 02:56:21 +00:00
|
|
|
/// Configuration for this Angel instance.
|
|
|
|
library angel.config;
|
|
|
|
|
|
|
|
import 'dart:io';
|
2016-12-21 22:05:11 +00:00
|
|
|
import 'package:angel_common/angel_common.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.
|
2016-04-29 01:22:53 +00:00
|
|
|
configureServer(Angel app) async {
|
2017-06-10 15:24:36 +00:00
|
|
|
// Load configuration from the `config/` directory.
|
|
|
|
//
|
|
|
|
// See: https://github.com/angel-dart/configuration
|
2017-01-01 08:03:22 +00:00
|
|
|
await app.configure(loadConfigurationFile());
|
2016-12-24 18:32:47 +00:00
|
|
|
|
2017-06-10 15:24:36 +00:00
|
|
|
// Configure our application to render Mustache templates from the `views/` directory.
|
|
|
|
//
|
|
|
|
// See: https://github.com/angel-dart/mustache
|
2017-01-01 08:03:22 +00:00
|
|
|
await app.configure(mustache(new Directory('views')));
|
|
|
|
|
2017-06-10 15:24:36 +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.
|
2016-12-24 18:32:47 +00:00
|
|
|
//
|
2017-06-10 15:24:36 +00:00
|
|
|
// 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
|
|
|
}
|