Update config.dart

This commit is contained in:
Tobe O 2017-01-01 03:03:22 -05:00 committed by GitHub
parent 691bc2f637
commit c68f2d981a

View file

@ -9,10 +9,16 @@ import 'plugins/plugins.dart' as plugins;
/// This is a perfect place to include configuration and load plug-ins. /// This is a perfect place to include configuration and load plug-ins.
configureServer(Angel app) async { configureServer(Angel app) async {
await app.configure(loadConfigurationFile());
var db = new Db(app.mongo_db); var db = new Db(app.mongo_db);
await db.open(); await db.open();
app.container.singleton(db); app.container.singleton(db);
await app.configure(mustache(new Directory('views')));
await plugins.configureServer(app);
// Uncomment this to enable session synchronization across instances. // Uncomment this to enable session synchronization across instances.
// This will add the overhead of querying a database at the beginning // This will add the overhead of querying a database at the beginning
// and end of every request. Thus, it should only be activated if necessary. // and end of every request. Thus, it should only be activated if necessary.
@ -20,8 +26,4 @@ configureServer(Angel app) async {
// For applications of scale, it is better to steer clear of session use // For applications of scale, it is better to steer clear of session use
// entirely. // entirely.
// await app.configure(new MongoSessionSynchronizer(db.collection('sessions'))); // await app.configure(new MongoSessionSynchronizer(db.collection('sessions')));
await app.configure(loadConfigurationFile());
await app.configure(mustache(new Directory('views')));
await plugins.configureServer(app);
} }