Unify oss and internal version of status page middleware

Reviewed By: @vjeux

Differential Revision: D2519415

fb-gh-sync-id: 2cf27c88b29c18a7a1f3aa1611f0d7f510a8fa24
This commit is contained in:
Martín Bigio 2015-10-08 14:15:15 -07:00 коммит произвёл facebook-github-bot-4
Родитель f37ad56afd
Коммит f980c33073
2 изменённых файлов: 22 добавлений и 11 удалений

Просмотреть файл

@ -23,6 +23,7 @@ const getDevToolsMiddleware = require('./getDevToolsMiddleware');
const openStackFrameInEditorMiddleware = require('./openStackFrameInEditorMiddleware');
const parseCommandLine = require('./parseCommandLine.js');
const ReactPackager = require('./react-packager');
const statusPageMiddleware = require('./statusPageMiddleware.js');
const webSocketProxy = require('./webSocketProxy.js');
var options = parseCommandLine([{
@ -167,17 +168,6 @@ function loadRawBody(req, res, next) {
});
}
// A status page so the React/project.pbxproj build script
// can verify that packager is running on 8081 and not
// another program / service.
function statusPageMiddleware(req, res, next) {
if (req.url === '/status') {
res.end('packager-status:running');
} else {
next();
}
}
function systraceProfileMiddleware(req, res, next) {
if (req.url !== '/systrace') {
next();

Просмотреть файл

@ -0,0 +1,21 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* Status page so that anyone who needs to can verify that the packager is
* running on 8081 and not another program / service.
*/
module.exports = function(req, res, next) {
if (req.url === '/status') {
res.end('packager-status:running');
} else {
next();
}
};