devserver(跨域proxy)和socket,到底是什么东西

90 阅读1分钟

三样两语简单说清

平时项目接口结构

https:域名 + 接口 api

http://localhost:8080/zzz/one

http://localhost:8080/xxx/two

http://localhost:8080/xxx/three

 proxy代理多个接口 socket 长链接

http = api接口 需要的时候再请求

socket = 一直保持链接

module.exports = {
    // publicPath: '',
    outputDir: 'market-web',
    lintOnSave: false,
    pages: {
        'index': {
            entry: 'src/main.js',
            template: 'public/index.html',
            filename: 'index.html',
            title: 'simple demo index page'
        }
    },
    devServer: {
        open: true,
        openPage: '/index.html',
        port: 12998,
        proxy: {
            '/apis': {
                // target: 'http://localhost:12600',
                target: 'http://www.yumingjiekou.info:12600',
                pathRewrite: {'/apis': ''}
            }
        }
    }
}

image.png

b174a10d91b25daf7f80e43859d048c.png