You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "WarkeeperY (GitHub)" <gi...@apache.org> on 2019/01/04 02:55:50 UTC

[GitHub] [incubator-dubbo-ops] WarkeeperY commented on issue #209: dubbo-admin 是否能够分开部署?

> > 那个我理解只能对开发环境生效
> 
> 是的,在当前的npm里面是`dev`模式,是否可以满足你的需求?或者你需要的前后端分离的部署形式是什么样的?最好可以给一个参考的案例

是这样的,我们内网有一台专门用于部署前端项目的机器(只给了node环境),而后端则需要部署在其他机器上,所以如果直接npm run build,并分离部署dubbo-admin时,我猜测会因为前端只会尝试访问10.xxx.xxx.1:8080/service(假设该地址是前端机器的内网ip),而实际后端部署ip是10.xxx.xxx.2:8083。

目前我用了一种比较笨拙的方法(我前端技术掌握的比较少):将dubbo-admin的前端所有发ajax时请求的url前加了个全局静态变量baseUrl  比如:  
```
 this.$axios.get('/service', {
        params: {
          pattern: 'serviceName',
          filter: '*'
        }
      })
```
 ——>
```
this.$axios.get(baseUrl+'/service', {
        params: {
          pattern: 'serviceName',
          filter: '*'
        }
      })
```  
,并将baseUrl设定为10.xxx.xxx.2:8083(后端服务需要允许跨域)

希望以后dubbo-admin部署方式能够更加灵活一些吧

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org