How to use the mwp-config.getServer function in mwp-config

To help you get started, we’ve selected a few mwp-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github meetup / meetup-web-platform / packages / mwp-core / src / util / cookieUtils.js View on Github external
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';
github meetup / meetup-web-platform / packages / mwp-app-server / src / index.js View on Github external
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
github meetup / meetup-web-platform / packages / mwp-test-utils / src / mocks.js View on Github external
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,
	};
github meetup / meetup-web-platform / packages / mwp-api-proxy-plugin / src / config.js View on Github external
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;

mwp-config

All the config you might ever need for a MWP app

MIT
Latest version published 2 years ago

Package Health Score

39 / 100
Full package analysis

Similar packages