go-app icon indicating copy to clipboard operation
go-app copied to clipboard

Tutorial app doesn't start

Open andig opened this issue 2 years ago • 7 comments

Followed the getting started, with one change to the Makefile to match the executable name:

go build -o hello
make run
GOARCH=wasm GOOS=js go build -o web/app.wasm
go build -o hello
./hello

At this point, no UI or error is displayed. Not sure where to continue.

andig avatar Apr 12 '22 12:04 andig

@andig go-app does not launch the UI automatically, you need to point a browser at http://localhost:8000

mlctrez avatar Apr 12 '22 13:04 mlctrez

You need to open the browser at: http://localhost:8000

oderwat avatar Apr 12 '22 13:04 oderwat

Oh dear... thank you! Is there any tutorial or example how to bundle a standalone app (Electron?).

andig avatar Apr 12 '22 13:04 andig

Oh dear... thank you! Is there any tutorial or example how to bundle a standalone app (Electron?).

Not that I know of and go-app also is not meant to be used like that. It is for PWAs which can get installed by the user if he wishes to. So instead of letting a user download your Electron-based App for their platform, you simply tell them to follow the URL. You can prompt the user to install your app when he is opening the browser at that location.

Though there may be ways to distribute PWAs packages for different platforms and even put them into the App-Stores.

oderwat avatar Apr 12 '22 13:04 oderwat

I never tried with electron but it might be probably working since its chrome.

maxence-charriere avatar Apr 12 '22 14:04 maxence-charriere

Using Electron is something very different. I guess one could make something similar to go-app with Electron as a target.

There are projects like https://github.com/asticode/go-astilectron which do that.

Maybe one could try using this as basics: https://github.com/xtools-at/Electron-PWA-Wrapper

oderwat avatar Apr 12 '22 14:04 oderwat

I was thinking about it and one could use https://github.com/webview/webview (instead of Electron) to get rid of the browser dependency. It should be as easy as running the go-app server on a localhost port and loading this inside of webview running in another goroutine.

Edit: I just tried this and it "works" (using localhost on OSX). I did not try to package it into an app though.

oderwat avatar Apr 12 '22 15:04 oderwat