mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Allow packages to hook in before app html serving. Cherry picked from auth branch.
This commit is contained in:
committed by
Nick Martin
parent
ac06cbb4b6
commit
a2d5bfa6db
@@ -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(); });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user