Permalink
Browse files

fixes #3

  • Loading branch information...
1 parent bd1b86a commit a6e3e7a57631bf58abfba2ea2813485524740f3a @olegp committed Oct 20, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/mcms.js
View
@@ -1,6 +1,7 @@
-var fs = require('fs-base');
+var COMMON_NODE = global.process;
+var fs = require(COMMON_NODE ? 'fs-base' : 'fs');
+var mustache = require(COMMON_NODE ? 'mustache' : 'ringo/mustache').to_html;
var markdown = require('github-flavored-markdown').parse;
-var mustache = require('mustache').to_html;
var PAGES = './pages', TEMPLATES = './templates', STATIC = './static', SEPARATOR = '|';
var ABSOLUTE_STATIC = fs.absolute(STATIC);
@@ -103,4 +104,9 @@ exports.app = function(request) {
// TODO custom 404 pages
body: [page ? page.body : 'Not found']
};
-};
+};
+
+if(require.main === module) {
+ console.log('main');
+ require("ringo/httpserver").main(module.id);
+}

0 comments on commit a6e3e7a

Please sign in to comment.