Skip to content

Commit

Permalink
Merge pull request appium#1348 from jlipps/master
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
jlipps committed Oct 24, 2013
2 parents 461a397 + 4ae0cd9 commit b3b29e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var http = require('http')
, fs = require('fs')
, logger = require('./logger.js').get('appium')
, appium = require('../appium.js')
, bodyParser = require('./middleware').parserWrap
, parserWrap = require('./middleware').parserWrap
, status = require('./status.js')
, appiumVer = require('../../package.json').version
, appiumRev = null
Expand Down Expand Up @@ -87,7 +87,9 @@ var main = function(args, readyCb, doneCb) {
if (args.log || args.webhook) {
rest.use(express.logger({stream: winstonStream}));
}
rest.use(bodyParser);
rest.use(parserWrap);
rest.use(express.urlencoded());
rest.use(express.json());
rest.use(express.methodOverride());
rest.use(rest.router);
rest.use(catchAllHandler);
Expand Down
5 changes: 2 additions & 3 deletions lib/server/middleware.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use strict";

var express = require('express')
, _s = require('underscore.string')
, bodyParser = express.bodyParser();
, _s = require('underscore.string');

module.exports.parserWrap = function(req, res, next) {
// wd.js sends us http POSTs with empty body which will make bodyParser fail.
Expand All @@ -18,6 +17,6 @@ module.exports.parserWrap = function(req, res, next) {
req.headers['content-type'] = 'application/json';
}
}
bodyParser(req, res, next);
next();
}
};
2 changes: 2 additions & 0 deletions reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ reset_general() {
echo "* Removing NPM modules"
run_cmd rm -rf node_modules
fi
echo "* Clearing out old .appiumconfig"
run_cmd rm -rf ./.appiumconfig
if $include_dev ; then
echo "* Installing new or updated NPM modules (including devDeps)"
run_cmd npm install .
Expand Down

0 comments on commit b3b29e7

Please sign in to comment.