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

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

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