Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions packages/cli/src/commands/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
*/

import Metro from 'metro';

import {Terminal} from 'metro-core';

import morgan from 'morgan';
import path from 'path';
import {logger} from '@react-native-community/cli-tools';
import type {ConfigT} from '../../tools/config/types.flow';
import messageSocket from './messageSocket';
import webSocketProxy from './webSocketProxy';
import MiddlewareManager from './middleware/MiddlewareManager';

import loadMetroConfig from '../../tools/loadMetroConfig';

export type Args = {|
Expand Down Expand Up @@ -62,7 +60,14 @@ async function runServer(argv: Array<string>, ctx: ConfigT, args: Args) {
watchFolders: metroConfig.watchFolders,
});

middlewareManager.getConnectInstance().use(morgan('combined'));
middlewareManager.getConnectInstance().use(
morgan(
'combined',
!logger.isVerbose() && {
skip: (req, res) => res.statusCode < 400,
},
),
);

metroConfig.watchFolders.forEach(
middlewareManager.serveStatic.bind(middlewareManager),
Expand Down