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

module.exports = function(app) {
  const base = process.env.PUBLIC_URL;
  console.log(`http-proxy-middleware ${base}`);
  app.use(createProxyMiddleware(
    `${base}/api/v1/games/ws`, {
      ws: true,
      target: 'http://localhost:8930',
      changeOrigin: true,
  }));
};
