@cxco/dev-proxy

To help us develop our Virtual Assistants on the client website by proxying it.

Stats

StarsIssuesVersionUpdatedCreatedSize
@cxco/dev-proxy
0.3.03 years ago3 years agoMinified + gzip package size for @cxco/dev-proxy in KB

Readme

Dev-Proxy

To help us develop our Virtual Assistants on the client website by proxying it.

How do I get set up?

npm install @cxco/dev-proxy

Set up in your gulpfile:

    const argv = require('yargs').argv;
    const config = require('./gulp.config')();
    const browserSync = require('browser-sync').create();
    const cxProxyConfig = require('./cx-proxy.config');
    const CxProxy = require('@cxco/dev-proxy').default;

    // ... other gulp tasks and requires

    // serve and watch files
    gulp.task('watch', ['build'], async () => {
        let port
        let browserSyncConfig = {};

        if (proxy) {
            port = await (new CxProxy(cxProxyConfig)).start();
            browserSyncConfig.proxy = `localhost:${port}`;
        } else {
            browserSyncConfig.server = {
                baseDir: `./${config.build}`
            }
        }

        browserSync.init(browserSyncConfig);

        gulp.watch(config.watch, ['bs-reload']);
        gulp.watch(config.scss, () => buildCss(true));
    });

Configuration

To use the Dev-Proxy in your project you will also need a configuration file. You can use the cx-proxy.config.example file to start with.

Publishing

Increment version with npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]

To publish this package to NPMJS.com run npm publish with an authenticated user.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.