const proxy = require('http-proxy-middleware')

module.exports = app => {
  app.use(
    proxy('/api', {
      // target: 'http://192.168.0.10:8082',
      target: 'http://data3d.4dage.com/',
      changeOrigin: true,
      pathRewrite: {
        "^/api": "/api"
      }
    })
  )

  app.use(
    proxy('/test', {
      // target: 'http://192.168.0.10:8082',
      target: 'http://data3d.4dage.com/',
      changeOrigin: true,
      pathRewrite: {
        "^/test": "/"
      }
    })
  )
}