mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
replaced eslint:recommended with prettier
This commit is contained in:
@@ -6,11 +6,11 @@ const merge = require('lodash/merge');
|
||||
const helmet = require('helmet');
|
||||
const plugins = require('./services/plugins');
|
||||
const compression = require('compression');
|
||||
const {HELMET_CONFIGURATION} = require('./config');
|
||||
const {MOUNT_PATH} = require('./url');
|
||||
const { HELMET_CONFIGURATION } = require('./config');
|
||||
const { MOUNT_PATH } = require('./url');
|
||||
const routes = require('./routes');
|
||||
const debug = require('debug')('talk:app');
|
||||
const {ENABLE_TRACING, APOLLO_ENGINE_KEY, PORT} = require('./config');
|
||||
const { ENABLE_TRACING, APOLLO_ENGINE_KEY, PORT } = require('./config');
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -26,7 +26,7 @@ app.use((req, res, next) => {
|
||||
//==============================================================================
|
||||
|
||||
// Inject server route plugins.
|
||||
plugins.get('server', 'app').forEach(({plugin, app: callback}) => {
|
||||
plugins.get('server', 'app').forEach(({ plugin, app: callback }) => {
|
||||
debug(`added plugin '${plugin.name}'`);
|
||||
|
||||
// Pass the app to the plugin to mount it's routes.
|
||||
@@ -43,11 +43,11 @@ if (process.env.NODE_ENV !== 'test') {
|
||||
}
|
||||
|
||||
if (ENABLE_TRACING && APOLLO_ENGINE_KEY) {
|
||||
const {Engine} = require('apollo-engine');
|
||||
const { Engine } = require('apollo-engine');
|
||||
|
||||
const engine = new Engine({
|
||||
engineConfig: {
|
||||
apiKey: APOLLO_ENGINE_KEY
|
||||
apiKey: APOLLO_ENGINE_KEY,
|
||||
},
|
||||
graphqlPort: PORT,
|
||||
endpoint: `${MOUNT_PATH}api/v1/graph/ql`,
|
||||
@@ -64,9 +64,13 @@ app.set('trust proxy', 1);
|
||||
|
||||
// Enable a suite of security good practices through helmet. We disable
|
||||
// frameguard to allow crossdomain injection of the embed.
|
||||
app.use(helmet(merge(HELMET_CONFIGURATION, {
|
||||
frameguard: false,
|
||||
})));
|
||||
app.use(
|
||||
helmet(
|
||||
merge(HELMET_CONFIGURATION, {
|
||||
frameguard: false,
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
// Compress the responses if appropriate.
|
||||
app.use(compression());
|
||||
|
||||
Reference in New Issue
Block a user