Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

razzle-plugin-spa-api-proxy

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

razzle-plugin-spa-api-proxy

unpublished
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

razzle-plugin-spa-api-proxy

This module contains a plugin to proxy API requests for SPA build type using Webpack dev server proxy with Razzle.

Usage in Razzle Projects

yarn add razzle-plugin-spa-api-proxy --dev

With default options

// razzle.config.js

module.exports = {
  plugins: ['spa-api-proxy'],
};

All request with path starting with /api will be directed to http://localhost:8080/api.

With custom config

// razzle.config.js

module.exports = {
  plugins: [
    {
      name: 'spa-api-proxy',
      options: {
        clientPath: '/custom-api',
        apiUrl: 'https://my-api.example.com'
      },
    },
  ],
};

Options

Object with fields below or array of such objects if you need to proxy sever paths.

clientPath

default: /api

Path that will be directed to API server

apiHost

default: localhost

API server host

apiPort

default: 8080

API server port

useSSL

default: false

Use HTTPS connection

apiUrl

default: http://localhost:8080

Shorthand for apiHost, apiPort and useSSL options. Will override former if both are present.

FAQs

Package last updated on 27 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts