diff --git a/app/server/server.js b/app/server/server.js index d6b651363a..8738ccb9d9 100644 --- a/app/server/server.js +++ b/app/server/server.js @@ -80,21 +80,6 @@ var run = function () { app_html = runtime_config(app_html); - app.use(function (req, res) { - // prevent favicon.ico and robots.txt from returning app_html - if (_.indexOf(['/favicon.ico', '/robots.txt'], req.url) !== -1) { - res.writeHead(404); - res.end(); - return; - } - - res.writeHead(200, {'Content-Type': 'text/html'}); - if (supported_browser(req.headers['user-agent'])) - res.write(app_html); - else - res.write(unsupported_html); - res.end(); - }); // read bundle config file var info_raw = @@ -127,6 +112,22 @@ var run = function () { require('vm').runInThisContext(code, filename, true); }); + app.use(function (req, res) { + // prevent favicon.ico and robots.txt from returning app_html + if (_.indexOf(['/favicon.ico', '/robots.txt'], req.url) !== -1) { + res.writeHead(404); + res.end(); + return; + } + + res.writeHead(200, {'Content-Type': 'text/html'}); + if (supported_browser(req.headers['user-agent'])) + res.write(app_html); + else + res.write(unsupported_html); + res.end(); + }); + // run the user startup hooks. _.each(__meteor_bootstrap__.startup_hooks, function (x) { x(); });