From c68f2d981ae4ee243ff5a738f66776d3963605c6 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sun, 1 Jan 2017 03:03:22 -0500 Subject: [PATCH] Update config.dart --- lib/src/config/config.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/config/config.dart b/lib/src/config/config.dart index 5582b5c..35c4939 100644 --- a/lib/src/config/config.dart +++ b/lib/src/config/config.dart @@ -9,10 +9,16 @@ import 'plugins/plugins.dart' as plugins; /// This is a perfect place to include configuration and load plug-ins. configureServer(Angel app) async { + + await app.configure(loadConfigurationFile()); var db = new Db(app.mongo_db); await db.open(); app.container.singleton(db); + await app.configure(mustache(new Directory('views'))); + await plugins.configureServer(app); + + // Uncomment this to enable session synchronization across instances. // 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. @@ -20,8 +26,4 @@ configureServer(Angel app) async { // For applications of scale, it is better to steer clear of session use // entirely. // await app.configure(new MongoSessionSynchronizer(db.collection('sessions'))); - - await app.configure(loadConfigurationFile()); - await app.configure(mustache(new Directory('views'))); - await plugins.configureServer(app); }