client/README.md

60 lines
953 B
Markdown
Raw Normal View History

2024-06-07 15:33:03 +08:00
# client
create a web client
client plugin for web client framework by https://github.com/webview/webview_go
### create project and init client project
```shell
go install apigo.cloud/git/apigo/ag@latest
mkdir demo && cd demo
ag init client
```
### edit main.js
```javascript
import client from 'apigo.cloud/git/apigo/client'
let w = client.new('Hello', 800, 500)
w.loadFile('www/index.html')
w.run()
```
### tidy & run
```shell
ag tidy
ag run
```
### build
```shell
CGO_ENABLED=1 go build -o demo *.go
```
### build on windows
```shell
CGO_ENABLED=1 go build -o demo.exe -ldflags '-H windowsgui' *.go
```
[//]: # (### build for windows)
[//]: # (```shell)
[//]: # (CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CGO_LDFLAGS="-static" CC=/usr/local/Cellar/mingw-w64/9.0.0_2/bin/x86_64-w64-mingw32-gcc CXX=/usr/local/Cellar/mingw-w64/9.0.0_2/bin/x86_64-w64-mingw32-g++ go build -o demo.exe -ldflags '-H windowsgui' *.go)
[//]: # (```)