const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
    app.use(
        '/api',
        createProxyMiddleware({
            target: 'https://back.fool-stack.ru',
            changeOrigin: true,
            pathRewrite: { '^/api': '/api' },
        })
    );
    app.use(
        '/static/avatars',
        createProxyMiddleware({
            target: 'http://back.fool-stack.ru',
            changeOrigin: true,
        })
    );
};
