Commit 3c7def44 authored by jgutix's avatar jgutix

Load a yaml file for configuration in pusher.js

parent 8ef79dd0
# Basic config file example for use as command line option
# Can set any options in here and pass file as option
# Command line flags will override these settings if you need granularity
activity_timeout: 150
api_port: 1234
app_key: '44332211ffeeddccbbaa'
secret: 'secret'
tls_options:
cert_chain_file: 'mycert.cer'
private_key_file: 'my.key'
# Other config items for ink
http_host: 'localhost'
http_port: 4567
web_host: 'localhost'
web_port: 4444
\ No newline at end of file
const SLANGER_APP_KEY = "44332211ffeeddccbbaa";
const SLANGER_HTTP_HOST = "localhost";
const SLANGER_HTTP_PORT = 4567;
const SLANGER_WEB_HOST = "localhost";
const SLANGER_WEB_PORT = 4444;
import { configurePusher } from 'pusher-redux';
const config = require("json!yaml!./config/slanger.yml");
const options = {
appKey: SLANGER_APP_KEY,
httpHost: SLANGER_HTTP_HOST,
httpPort: SLANGER_HTTP_PORT,
wsHost: SLANGER_WEB_HOST,
wsPort: SLANGER_WEB_PORT
appKey: config.app_key,
httpHost: config.http_host,
httpPort: config.http_port,
wsHost: config.web_host,
wsPort: config.web_port
};
export function setupPusher(store) {
configurePusher(store, SLANGER_APP_KEY, options);
console.log(config);
configurePusher(store, config.app_key, options);
}
......@@ -55,7 +55,11 @@ const getLoaders = function (env) {
// { test: /\.(woff|woff2|eot|ttf|svg)$/, loader: 'file-loader?name="[name]-[hash].[ext]"'},
{ test: /\.(scss)$/, loaders: ["style", "css", "sass"] },
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
{
test: /\.yaml$/,
loader: 'yaml',
}
// { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
// { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment