How to use the @vendure/core.createProxyHandler function in @vendure/core

To help you get started, we’ve selected a few @vendure/core 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 vendure-ecommerce / vendure / packages / email-plugin / src / plugin.ts View on Github external
static configure(config: RuntimeVendureConfig): RuntimeVendureConfig {
        if (isDevModeOptions(this.options) && this.options.mailboxPort !== undefined) {
            const route = 'mailbox';
            config.middleware.push({
                handler: createProxyHandler({ port: this.options.mailboxPort, route, label: 'Dev Mailbox' }),
                route,
            });
        }
        return config;
    }
github vendure-ecommerce / vendure / packages / asset-server-plugin / src / plugin.ts View on Github external
static configure(config: RuntimeVendureConfig) {
        this.assetStorage = this.createAssetStorageStrategy(this.options);
        config.assetOptions.assetPreviewStrategy = new SharpAssetPreviewStrategy({
            maxWidth: this.options.previewMaxWidth || 1600,
            maxHeight: this.options.previewMaxHeight || 1600,
        });
        config.assetOptions.assetStorageStrategy = this.assetStorage;
        config.middleware.push({
            handler: createProxyHandler({ ...this.options, label: 'Asset Server' }),
            route: this.options.route,
        });
        return config;
    }
github vendure-ecommerce / vendure / packages / admin-ui-plugin / src / plugin.ts View on Github external
static async configure(config: RuntimeVendureConfig): Promise {
        const route = 'admin';
        config.middleware.push({
            handler: createProxyHandler({
                ...this.options,
                route: 'admin',
                label: 'Admin UI',
                basePath: this.options.watch ? 'admin' : undefined,
            }),
            route,
        });
        if (this.options.watch) {
            config.middleware.push({
                handler: createProxyHandler({
                    ...this.options,
                    route: 'sockjs-node',
                    label: 'Admin UI live reload',
                    basePath: 'sockjs-node',
                }),
                route: 'sockjs-node',
            });
        }
        return config;
    }