An open API service indexing awesome lists of open source software.

https://github.com/deraw/vue-cli-plugin-proxy

🔌 Provide all http-proxy-middleware options to vue-cli
https://github.com/deraw/vue-cli-plugin-proxy

http-proxy-middleware vue-cli

Last synced: 8 months ago
JSON representation

🔌 Provide all http-proxy-middleware options to vue-cli

Awesome Lists containing this project

README

          



Vue CLI proxy plugin

This plugin is meant to provide all http-proxy-middleware options to vue-cli.


NPM Version
NPM Downloads
License
The issue

## Issue

See [the issue than initiated this plugin (#2320)](https://github.com/vuejs/vue-cli/issues/2320)

## Installation

``` bash
yarn add @deraw/vue-cli-plugin-proxy
# OR npm install @deraw/vue-cli-plugin-proxy
```

## Usage

```js
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
enabled: true,
context: '',
options: {
// ...
}
}
}
}
```

## Options

See [http-proxy-middleware](https://www.npmjs.com/package/http-proxy-middleware#tldr) for `options` object to pass to the plugin.

### Object examples

* First example of the docs:

```js
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
enabled: true,
context: '/api',
options: {
target: 'http://www.example.org',
changeOrigin: true
}
}
}
}
```

* v1.0.0 default:

```js
// vue.config.js
module.exports = {
pluginOptions: {
proxy: {
enabled: true,
context: [
'/**',
'!/dist/**'
],
options: {
target: 'http://127.0.0.1:8000'
}
}
}
}
```

## License

Vue CLI Plugin Proxy is licensed under [MIT License](./LICENSE).