Skip to content

Commit

Permalink
Upgrade connect dependency
Browse files Browse the repository at this point in the history
Reviewed By: cpojer

Differential Revision: D6732727

fbshipit-source-id: 80181ef184c90e3312789579034d70e2c3bcbf98
  • Loading branch information
rafeca authored and facebook-github-bot committed Jan 17, 2018
1 parent 9e34cbd commit 709ede7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 8 additions & 7 deletions local-cli/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const HmrServer = require('metro/src/HmrServer');
const {Terminal} = require('metro-core');

const attachWebsocketServer = require('./util/attachWebsocketServer');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const compression = require('compression');
const connect = require('connect');
const copyToClipBoardMiddleware = require('./middleware/copyToClipBoardMiddleware');
const defaultAssetExts = Metro.defaults.assetExts;
Expand All @@ -34,15 +32,18 @@ const defaultPlatforms = Metro.defaults.platforms;
* run Flow. */
const defaultProvidesModuleNodeModules =
Metro.defaults.providesModuleNodeModules;
const errorhandler = require('errorhandler');
const fs = require('fs');
const getDevToolsMiddleware = require('./middleware/getDevToolsMiddleware');
const http = require('http');
const https = require('https');
const indexPageMiddleware = require('./middleware/indexPage');
const loadRawBodyMiddleware = require('./middleware/loadRawBodyMiddleware');
const messageSocket = require('./util/messageSocket.js');
const morgan = require('morgan');
const openStackFrameInEditorMiddleware = require('./middleware/openStackFrameInEditorMiddleware');
const path = require('path');
const serveStatic = require('serve-static');
const statusPageMiddleware = require('./middleware/statusPageMiddleware.js');
const systraceProfileMiddleware = require('./middleware/systraceProfileMiddleware.js');
const webSocketProxy = require('./util/webSocketProxy.js');
Expand Down Expand Up @@ -92,10 +93,10 @@ function runServer(

const app = connect()
.use(loadRawBodyMiddleware)
.use(connect.compress())
.use(compression())
.use(
'/debugger-ui',
connect.static(path.join(__dirname, 'util', 'debugger-ui')),
serveStatic(path.join(__dirname, 'util', 'debugger-ui')),
)
.use(
getDevToolsMiddleware(args, () => wsProxy && wsProxy.isChromeConnected()),
Expand All @@ -108,9 +109,9 @@ function runServer(
.use(indexPageMiddleware)
.use(packagerServer.processRequest.bind(packagerServer));

args.projectRoots.forEach(root => app.use(connect.static(root)));
args.projectRoots.forEach(root => app.use(serveStatic(root)));

app.use(connect.logger()).use(connect.errorHandler());
app.use(morgan('combined')).use(errorhandler());

if (args.https && (!args.key || !args.cert)) {
throw new Error('Cannot use https without specifying key and cert options');
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@
"base64-js": "^1.1.2",
"chalk": "^1.1.1",
"commander": "^2.9.0",
"connect": "^2.8.3",
"compression": "^1.7.1",
"connect": "^3.6.5",
"create-react-class": "^15.5.2",
"debug": "^2.2.0",
"denodeify": "^1.2.1",
"envinfo": "^3.0.0",
"errorhandler": "^1.5.0",
"event-target-shim": "^1.0.5",
"fbjs": "^0.8.14",
"fbjs-scripts": "^0.8.1",
Expand All @@ -177,6 +179,7 @@
"mime": "^1.3.4",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"morgan": "^1.9.0",
"node-fetch": "^1.3.3",
"node-notifier": "^5.1.2",
"npmlog": "^2.0.4",
Expand All @@ -192,6 +195,7 @@
"regenerator-runtime": "^0.11.0",
"rimraf": "^2.5.4",
"semver": "^5.0.3",
"serve-static": "^1.13.1",
"shell-quote": "1.6.1",
"stacktrace-parser": "^0.1.3",
"whatwg-fetch": "^1.0.0",
Expand Down

0 comments on commit 709ede7

Please sign in to comment.