Do not use morgan internally
Summary: `morgan` produces non-json output, which affects `js1 run` when ran with the `--json` flag. Reviewed By: Kureev Differential Revision: D8724830 fbshipit-source-id: 11377f6ef39341c658a7f905383398423a721630
This commit is contained in:
parent
ba56725eb8
commit
bbc8bb1f9d
|
@ -11,7 +11,6 @@
|
|||
const compression = require('compression');
|
||||
const connect = require('connect');
|
||||
const errorhandler = require('errorhandler');
|
||||
const morgan = require('morgan');
|
||||
const path = require('path');
|
||||
const serveStatic = require('serve-static');
|
||||
const WebSocketServer = require('ws').Server;
|
||||
|
@ -33,7 +32,8 @@ type WebSocketProxy = {
|
|||
server: WebSocketServer,
|
||||
isChromeConnected: () => boolean,
|
||||
};
|
||||
type Connect = any;
|
||||
|
||||
type Connect = $Call<connect>;
|
||||
|
||||
module.exports = class MiddlewareManager {
|
||||
app: Connect;
|
||||
|
@ -52,7 +52,6 @@ module.exports = class MiddlewareManager {
|
|||
.use(statusPageMiddleware)
|
||||
.use(systraceProfileMiddleware)
|
||||
.use(indexPageMiddleware)
|
||||
.use(morgan('combined'))
|
||||
.use(errorhandler());
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ const Metro = require('metro');
|
|||
|
||||
const {Terminal} = require('metro-core');
|
||||
|
||||
const morgan = require('morgan');
|
||||
const path = require('path');
|
||||
const MiddlewareManager = require('./middleware/MiddlewareManager');
|
||||
|
||||
|
@ -47,6 +48,8 @@ async function runServer(args: Args, config: ConfigT) {
|
|||
const reporter = new ReporterImpl(terminal);
|
||||
const middlewareManager = new MiddlewareManager(args);
|
||||
|
||||
middlewareManager.getConnectInstance().use(morgan('combined'));
|
||||
|
||||
args.watchFolders.forEach(middlewareManager.serveStatic);
|
||||
|
||||
const serverInstance = await Metro.runServer({
|
||||
|
|
Loading…
Reference in New Issue