Skip to content

Commit

Permalink
Merge branch 'master' into tests-roomFlag-tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
annyhe committed Aug 14, 2017
2 parents fcb57de + 3d7b326 commit 3dc288e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
21 changes: 11 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const WORKERS = process.env.WEB_CONCURRENCY || DEFAULT_WEB_CONCURRENCY;
const sampleStore = require('./cache/sampleStoreInit');

/**
* Entry point for each newly clustered process
* Entry point for each clustered process.
*/
function start() { // eslint-disable-line max-statements
const featureToggles = require('feature-toggles');
Expand Down Expand Up @@ -65,11 +65,9 @@ function start() { // eslint-disable-line max-statements
});

/*
* Compress(gzip) all the api responses and all the static files.
* Since this is called before the static pages and the API routes, this will
* ensure that both the static pages and the API response are compressed.
* Call this *before* the static pages and the API routes so that both the
* static pages *and* the API responses are compressed (gzip).
*/

app.use(compress());

const httpServer = require('http').Server(app);
Expand Down Expand Up @@ -177,13 +175,15 @@ function start() { // eslint-disable-line max-statements
// Keep browsers from sniffing mimetypes
app.use(helmet.noSniff());

// Redirect '/' to '/v1'.
/*
* Redirect '/' to the application landing page, which right now is the
* default perspective (or the first perspective in alphabetical order if
* no perspective is defined as the default).
*/
app.get('/', (req, res) => res.redirect('/perspectives'));

// set json payload limit
app.use(bodyParser.json(
{ limit: conf.payloadLimit }
));
// Set the JSON payload limit.
app.use(bodyParser.json({ limit: conf.payloadLimit }));

/*
* Interpret Swagger resources and attach metadata to request - must be
Expand Down Expand Up @@ -236,6 +236,7 @@ function start() { // eslint-disable-line max-statements

// create app routes
require('./view/loadView')(app, passportModule, '/v1');

module.exports = { app, passportModule };
}

Expand Down
1 change: 0 additions & 1 deletion tests/view/components/errorRenderTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* tests/view/components/errorRenderTest.js
*/
'use strict';

import React from 'react';
import TestUtils from 'react-addons-test-utils';
import { expect } from 'chai';
Expand Down
1 change: 0 additions & 1 deletion tests/view/components/formTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* tests/view/components/formTest.js
*/
'use strict';

import React from 'react';
import TestUtils from 'react-addons-test-utils';
import { expect } from 'chai';
Expand Down
1 change: 0 additions & 1 deletion tests/view/perspectives/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* tests/view/perspectives/app.js
*/
'use strict';

const chai = require('chai');
const expect = chai.expect;
import { getFilterQuery,
Expand Down
1 change: 0 additions & 1 deletion tests/view/perspectives/eventsQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* tests/view/perspectives/eventsQueue.js
*/
'use strict';

const expect = require('chai').expect;
const eventsQueue = require(
'../../../view/perspective/eventsQueue'
Expand Down
1 change: 0 additions & 1 deletion tests/view/perspectives/loadPerspectivePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* tests/view/perspectives/loadPerspectivePicker.js
*/
'use strict';

const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
Expand Down

0 comments on commit 3dc288e

Please sign in to comment.