Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import querystring from 'qs';
import config from 'mwp-config';
const appConfig = config.getServer().properties;
export const MEMBER_COOKIE = appConfig.api.isProd
? 'MEETUP_MEMBER'
: 'MEETUP_MEMBER_DEV';
export const BROWSER_ID_COOKIE = appConfig.api.isProd
? 'MEETUP_BROWSER_ID'
: 'MEETUP_BROWSER_ID_DEV';
// SIFT_SESSION_ID cookie created in fastly and used by sift science to correlate spammy
// behavior to user activity; cookie has an expiration time of 4 hours and should be
// reset on logout. For more details please refer https://sift.com/resources/tutorials/anonymous-users
export const SIFT_SESSION_COOKIE = appConfig.api.isProd
? 'SIFT_SESSION_ID'
: 'SIFT_SESSION_ID_DEV';
import './util/globals';
import fs from 'fs';
import Http2 from 'spdy'; // eventually this will be a native node module
import config from 'mwp-config';
import getRoutes from './routes';
import getPlugins from './util/getPlugins';
import { configureEnv, server } from './util';
const appConfig = config.getServer().properties;
/**
* @module server
*/
/**
* The start function applies the rendering function to the correct application
* route and combines the provided routes and plugins with the base routes
* and plugins
*
* @param {Object} languageRenderers A mapping of localeCodes to functions that emit
* the rendered HTML for the locale-specific request
* @param {Array} routes additional routes for the app - cannot include a
* wildcard route
* @param {Array} plugins additional plugins for the server, usually to support
* features in the additional routes
import csrf from 'electrode-csrf-jwt/lib/csrf';
import uuid from 'uuid';
import config from 'mwp-config';
import makeRenderer from 'mwp-core/lib/server-render';
const appConfig = config.getServer().properties;
import { clientFilename, routes, reducer } from 'mwp-test-utils/lib/mockApp';
export const getMockFetch = (mockResponseValue = { responses: [{}] }, headers = {}) =>
Promise.resolve({
text: () => Promise.resolve(JSON.stringify(mockResponseValue)),
json: () => Promise.resolve(mockResponseValue),
headers: {
get: key => headers[key],
},
});
export function getCsrfHeaders() {
const options = {
secret: appConfig.csrf_secret,
};
import { getServer } from 'mwp-config';
export const API_PROXY_PLUGIN_NAME = 'mwp-api-proxy-plugin';
export const API_ROUTE_PATH = getServer().properties.app_server.api_proxy_path;