Permalink
Browse files

Check express and connect specific features

  • Loading branch information...
1 parent 3e91f2f commit 15c4624365d7d8bcceb66e31c489e73eef45c98c @camshaft committed Jan 8, 2013
Showing with 8 additions and 0 deletions.
  1. +2 −0 bin/startup-middleware
  2. +2 −0 bin/startup-routes
  3. +2 −0 bin/startup-settings
  4. +2 −0 lib/runner.js
View
@@ -27,6 +27,8 @@ var table = new Table({
colWidths: [20, 60]
});
+if (!app.stack) return console.error("Express or Connect required for this feature");
+
app.stack.forEach(function(middleware) {
table.push([(middleware.route || '/'), middleware.handle.name]);
});
View
@@ -27,6 +27,8 @@ var table = new Table({
colWidths: [8, 20, 70]
});
+if (!app.routes) return console.error("Express required for this feature");
+
for(var method in app.routes) {
app.routes[method].forEach(function(route) {
table.push([method, route.path, route.callbacks.join("\n")]);
View
@@ -27,6 +27,8 @@ var table = new Table({
colWidths: [20, 80]
});
+if (!app.settings) return console.error("Express required for this feature");
+
for(var key in app.settings) {
table.push([key, app.settings[key]]);
}
View
@@ -58,6 +58,8 @@ module.exports = function(appPath) {
};
});
+ // TODO do we need to transfer properties from `app` to `server`?
+
// Start listening on our port
server.listen(port, function() {
console.log("Server listening on port " + port);

0 comments on commit 15c4624

Please sign in to comment.