如何在使用Golang作为GWT的后端时通过主机页面传递数据?

huangapple go评论66阅读模式
英文:

How to pass data by host page when using golang as gwt 's backend?

问题

目前,我的配置是这样的:

gwt+nginx+golang

nginx作为代理,将所有请求(在端口80上)重定向到golang服务器(在端口8080上)。由于我使用golang作为后端,所以我希望用户可以直接通过

www.domain.com

访问我的网站,而不需要指定主页,就像这样:

www.domain.com/index.html。

我认为在生产模式下应该很容易实现:只需将所有请求代理到golang服务上。问题是在开发模式下,没有主页的情况下,如何启动gwt应用程序?

英文:

Currently,my configuration is like this:

gwt+nginx+golang

,and nginx works as a proxy that will redirect all requests(on port:80) to golang server(on port:8080).Since I use golang as backend,so I want user to access my website by

www.domain.com 

directly without specifing host page like this:

www.domain.com/index.html.

I think it should be easy in production model:just proxy all requests on / to a golang service,question is on development model:without a host page,How to get gwt app run up?

答案1

得分: 0

DevMode实际上没有什么不同。首先,在服务器上部署一个编译版本,然后在-noserver模式下运行DevMode,并传递-startupUrl http://www.domain.com参数。它应该可以正常工作™。

英文:

DevMode is no different actually. Deploy a compiled version on your server once, then run DevMode in -noserver mode passing it -startupUrl http://www.domain.com. It should Just Work™.

huangapple
  • 本文由 发表于 2012年11月11日 10:44:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/13328153.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定