GWicke has submitted this change and it was merged.
Change subject: Revert "Upgrade express to 3.x and enable compression"
......................................................................
Revert "Upgrade express to 3.x and enable compression"
This reverts commit 3e13f3e997c77001b9f816a7406e5812da4310c2.
Change-Id: I2d955716d978a6eaf7af312b9903f36da03896cf
---
M js/api/ParserService.js
M js/package.json
2 files changed, 44 insertions(+), 25 deletions(-)
Approvals:
GWicke: Verified; Looks good to me, approved
diff --git a/js/api/ParserService.js b/js/api/ParserService.js
index 1b93573..10268aa 100644
--- a/js/api/ParserService.js
+++ b/js/api/ParserService.js
@@ -348,33 +348,13 @@
/* -------------------- web app access points below --------------------- */
-var app = express();
+var app = express.createServer();
// favicon
app.use(express.favicon(path.join(__dirname, "favicon.ico")));
-// Support gzip / deflate transfer-encoding
-//app.use(express.compress());
-
-// Support multipart/form-data parsing
-app.use(busboy({
- immediate: true,
- // Increase the form field size limit from the 1M default.
- limits: { fieldSize: 15 * 1024 * 1024 }
-}));
-
-app.use(function (req, res, next) {
- if ( !req.busboy ) {
- return next();
- }
- req.body = req.body || {};
- req.busboy.on('field', function ( field, val ) {
- req.body[field] = val;
- });
- req.busboy.on('end', function () {
- next();
- });
-});
+// Increase the form field size limit from the 2M default.
+app.use(express.bodyParser({maxFieldsSize: 15 * 1024 * 1024}));
app.get('/', function(req, res){
res.write('<html><body>\n');
@@ -735,8 +715,47 @@
});
+/**
+ * Continuous integration end points
+ *
+ * No longer used currently, as our testing now happens on the central Jenkins
+ * server.
+ */
+app.get( /\/_ci\/refs\/changes\/(\d+)\/(\d+)\/(\d+)/, function ( req, res ) {
+ var gerritChange = 'refs/changes/' + req.params[0] + '/' +
req.params[1] + '/' + req.params[2];
+ var testSh = spawn( './testGerritChange.sh', [ gerritChange ], {
+ cwd: '.'
+ } );
+
+ res.setHeader('Content-Type', 'text/xml; charset=UTF-8');
+
+ testSh.stdout.on( 'data', function ( data ) {
+ res.write( data );
+ } );
+
+ testSh.on( 'exit', function () {
+ res.end( '' );
+ } );
+} );
+
+app.get( /\/_ci\/master/, function ( req, res ) {
+ var testSh = spawn( './testGerritMaster.sh', [], {
+ cwd: '.'
+ } );
+
+ res.setHeader('Content-Type', 'text/xml; charset=UTF-8');
+
+ testSh.stdout.on( 'data', function ( data ) {
+ res.write( data );
+ } );
+
+ testSh.on( 'exit', function () {
+ res.end( '' );
+ } );
+} );
+
app.use( express.static( __dirname + '/scripts' ) );
-app.disable('x-powered-by');
+app.use( express.limit( '15mb' ) );
console.log( ' - ' + instanceName + ' ready' );
diff --git a/js/package.json b/js/package.json
index a0b3fce..3eae3b2 100644
--- a/js/package.json
+++ b/js/package.json
@@ -15,7 +15,7 @@
"pegjs": "0.7.x",
"lru-cache": "1.x.x",
"async": "0.x.x",
- "express": ">=3.0.0",
+ "express": "2.5.x",
"html5-entities": "~0.5.0",
"html5": "0.3.15",
"es6-shim":
"git+https://github.com/paulmillr/es6-shim#7dc668687c3a89ed9e7b6d6c6369f0ba8ebf8731",
--
To view, visit https://gerrit.wikimedia.org/r/93881
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d955716d978a6eaf7af312b9903f36da03896cf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits