UNPKG

@darwino/darwino

Version:

A set of Javascript classes and utilities

29 lines (24 loc) 802 B
/* * (c) Copyright Darwino Inc. 2014-2017. */ const DEV_OPTIONS = { DEVELOPMENT: false, WEBPACK: false, // Prefix to be added to the URL when using webpack // Note that the Darwino server must implement CORS, which is easily done using a filter serverPrefix: null, // In a prod app, the credentials should only be passed to the same origin // But for dev, we always include the credentials credentials: "same-origin" } export default DEV_OPTIONS; export function initDevOptions(httpUrl,wsUrl) { DEV_OPTIONS.DEVELOPMENT=true; let devpack = window.location.port==8008 if(devpack) { DEV_OPTIONS.WEBPACK = true; DEV_OPTIONS.serverPrefix = httpUrl; DEV_OPTIONS.wsPrefix = wsUrl; DEV_OPTIONS.credentials = "include"; } }