New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vite-plugin-show-proxy

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-show-proxy

show vite proxy when running in dev mode

latest
Source
npmnpm
Version
0.0.8
Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

vite-plugin-show-proxy

NPM version

Usage

vite.config.ts

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ShowProxy from 'vite-plugin-show-proxy'

export default defineConfig({
  plugins: [
    vue(),
    ShowProxy(),
  ],
  server: {
    proxy: {
      '/foo': 'http://localhost:4567',
      '/api': {
        target: 'http://jsonplaceholder.typicode.com',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, ''),
      },
      '^/fallback/.*': {
        target: 'http://jsonplaceholder.typicode.com',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/fallback/, ''),
      },
      '/socket.io': {
        target: 'ws://localhost:3000',
        ws: true,
      },
    },
  },
})

npm run dev
 vite v2.9.12 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 430ms.

  >Show Proxy:
    '/foo' => http://localhost:4567
    '/api' => http://jsonplaceholder.typicode.com
    '^/fallback/.*' => http://jsonplaceholder.typicode.com
    '/socket.io' => ws://localhost:3000

License

MIT License © 2022 yuyinws

FAQs

Package last updated on 26 Jun 2022

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