diff --git a/package.json b/package.json index a0d05c9..b4dccb6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "matador", "description": "an MVC framework for Node", - "version": "2.0.0-alpha.10", + "version": "2.0.0-alpha.11", "homepage": "https://github.com/Medium/matador", "main": "src/matador.js", "authors": [ @@ -23,7 +23,7 @@ "dependencies": { "connect": "2.3.3", "valentine": "1.8.0", - "soynode": "^0.7.0", + "soynode": "^1.0.0", "useragent": "~2.0.6" }, "devDependencies": { diff --git a/src/TemplateEngine.js b/src/TemplateEngine.js index 03af8a6..9a4c7a1 100644 --- a/src/TemplateEngine.js +++ b/src/TemplateEngine.js @@ -29,7 +29,10 @@ TemplateEngine.prototype.precompileTemplates = function (searchPaths, options, c var pathsLeft = searchPaths.length - function onPathDone(err) { + function onPathDone(dir, err) { + if (dir) { + console.log('Done compiling templates in', dir) + } pathsLeft-- if (err) { @@ -46,12 +49,12 @@ TemplateEngine.prototype.precompileTemplates = function (searchPaths, options, c dir = dir + '/views' if (!isDirectory(dir)) { - onPathDone(null) + onPathDone(null, null) return } console.log('Compiling Templates in', dir) - soynode.compileTemplates(dir, onPathDone) + soynode.compileTemplates(dir, onPathDone.bind(null, dir)) }) } diff --git a/src/all/server.js b/src/all/server.js index 9f7897c..4a64aaa 100644 --- a/src/all/server.js +++ b/src/all/server.js @@ -5,7 +5,12 @@ var matador = require('matador') app.useDevErrorHandler() app.useCommonMiddleware() -app.start() -app.listen(port) - -console.log('matador running on port ' + port) +app.start(function (err) { + if (err) { + console.error('matador failed to boot') + console.error(err) + } else { + app.listen(port) + console.log('matador running on port ' + port) + } +}) diff --git a/tests/integration/template_engine/afterBoot.sh b/tests/integration/template_engine/afterBoot.sh index f5627d9..bb7bb8a 100644 --- a/tests/integration/template_engine/afterBoot.sh +++ b/tests/integration/template_engine/afterBoot.sh @@ -1,2 +1,2 @@ # We need to wait for SoyNode to finish compiling -sleep 2 +sleep 3