Can I run a Go web server with HTML/JavaScript UI as a cross platform application (Linux, Android, iOS, macOS, Windows)

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

Can I run a Go web server with HTML/JavaScript UI as a cross platform application (Linux, Android, iOS, macOS, Windows)

问题

我正在尝试使用Go语言进行实验,作为一名Web开发者,我想探索使用相同的HTML/JavaScript/CSS UI在Linux、Android、iOS、macOS、Windows等平台上构建相同的Go Web服务的可能性。

我知道有一些框架,比如Electron、Cordova、gomobile,但似乎它们都不能同时与Go和Web UI一起工作,以生成适用于不同平台的Linux二进制文件、Android APK、Windows可执行文件、macOS dmg文件、iOS二进制文件(还不清楚具体格式),而不需要为不同平台编写不同的UI。

对于如何解决这个问题,你有什么建议吗?

英文:

I'm experimenting with Go and as I web developer I want to explore the possibilities of building the same Go web service with the same HTML/JavaScript/CSS UI cross platform for Linux, Android, iOS, macOS, Windows and so on.

I am aware of frameworks such as Electron, Cordova, gomobile but none of them seem to work both with Go and a web UI to generate several of Linux binary, Android APK, Windows exe, macOS dmg, iOS binary (don't know that format yet) without having to code different UIs for different platforms.

Any suggestions on how to solve this?

答案1

得分: 1

所有这些平台都有浏览器来渲染网页内容。像Cordova这样的框架将一个本地应用程序包装在浏览器组件(Web视图)周围。

缺失的部分是部署一个本地Go服务器,它将成为您应用程序的后端。据我所知,目前还没有跨平台的解决方案。

此外,在本地使用服务器违反了其主要目的(同时为多个客户端提供服务,保护远程存储的信息的安全性)。

英文:

All of these platforms have browsers to render web content. Frameworks like Cordova wrap a native app around a browser component (web view).

The missing part is deploying a local go server, that would be the backend of your app. AFAIK, there is no cross platform solution for this yet.

Also, using a server locally violates it's main purposes (serving many clients concurrently, security of remotely stored information).

huangapple
  • 本文由 发表于 2017年7月5日 23:42:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/44930698.html
匿名

发表评论

匿名网友

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

确定