Skip to content

How to use node debug webpack-dev-server proxy? #626

@mrdulin

Description

@mrdulin
 config.devServer = {
        contentBase: dist,
        historyApiFallback: true,
        colors: true,
        port: config.port,
        proxy: {
            '**': {
                target: 'http://apis.juhe.cn',
                secure: false,
                changeOrigin: true,
                bypass: (req, res, opt) => {
                    //I want to add a debug here!!
                    if (req.headers.accept.indexOf('html') !== -1) {
                        return dist + '/index.html';
                    }
                }
            } 
        }
    };

I want to use node debug webpack-dev-server proxy bypass function. How can i do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions