Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nuxtjs/proxy

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxtjs/proxy

[![npm](https://img.shields.io/npm/dt/@nuxtjs/proxy.svg?style=flat-square)](https://npmjs.com/package/@nuxtjs/proxy) [![npm (scoped with tag)](https://img.shields.io/npm/v/@nuxtjs/proxy/latest.svg?style=flat-square)](https://npmjs.com/package/@nuxtjs/prox

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
154K
decreased by-0.77%
Maintainers
3
Weekly downloads
 
Created

What is @nuxtjs/proxy?

@nuxtjs/proxy is a Nuxt.js module that allows you to easily configure proxy middleware for your Nuxt.js application. This is particularly useful for handling API requests during development, avoiding CORS issues, and routing requests to different backends.

What are @nuxtjs/proxy's main functionalities?

Basic Proxy Setup

This feature allows you to set up a basic proxy configuration. In this example, any request to `/api/` will be proxied to `http://api.example.com`, and the `/api/` prefix will be removed from the request path.

json
{
  "modules": [
    "@nuxtjs/proxy"
  ],
  "proxy": {
    "/api/": {
      "target": "http://api.example.com",
      "pathRewrite": { "^/api/": "" }
    }
  }
}

Multiple Proxies

This feature allows you to set up multiple proxy configurations. In this example, requests to `/api/` are proxied to `http://api.example.com`, and requests to `/auth/` are proxied to `http://auth.example.com`.

json
{
  "modules": [
    "@nuxtjs/proxy"
  ],
  "proxy": {
    "/api/": {
      "target": "http://api.example.com",
      "pathRewrite": { "^/api/": "" }
    },
    "/auth/": {
      "target": "http://auth.example.com",
      "pathRewrite": { "^/auth/": "" }
    }
  }
}

Custom Proxy Options

This feature allows you to customize proxy options. In this example, `changeOrigin` is set to `true` to change the origin of the host header to the target URL, and `secure` is set to `false` to allow self-signed SSL certificates.

json
{
  "modules": [
    "@nuxtjs/proxy"
  ],
  "proxy": {
    "/api/": {
      "target": "http://api.example.com",
      "pathRewrite": { "^/api/": "" },
      "changeOrigin": true,
      "secure": false
    }
  }
}

Other packages similar to @nuxtjs/proxy

FAQs

Package last updated on 20 Nov 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc