mirror of https://github.com/status-im/metro.git
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:
parent
e742683859
commit
b8a8df1052
12
packager.js
12
packager.js
|
@ -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();
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue