Socket
Socket
Sign inDemoInstall

@gauseen/nuxt-proxy

Package Overview
Dependencies
79
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @gauseen/nuxt-proxy

nuxt proxy module


Version published
Maintainers
1
Install size
3.85 MB
Created

Readme

Source

Nuxt.js Proxy Module

参考资料请看 nuxtjs api, nodejs 中间件 http-proxy-middleware api

使用步骤:

  1. 安装 @gauseen/nuxt-proxy 依赖资源
npm install --save-dev @gauseen/nuxt-proxy
  1. 添加 @gauseen/nuxt-proxy 资源至 nuxt.config.js 文件的 modules 对象之下

例如:

// nuxt.config.js

modules: [
	// 请求代理配置,解决跨域
	'@gauseen/nuxt-proxy',
],
proxyTable: {
	'/api': { target: 'http://example.com', ws: false }
},

注:

/api ———————— 每个接口特定标识字段 [String]
target —————— 目标代理服务 [String]
ws —————————— 是否支持 websocket 代理 [Boolean]

Keywords

FAQs

Last updated on 22 Mar 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc