-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
42 lines (35 loc) · 698 Bytes
/
Copy pathmain.go
File metadata and controls
42 lines (35 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//go:generate go-winres make --product-version=git-tag
package main
import (
v1 "LAN-sync/api/v1"
"embed"
"fmt"
"github.com/zserge/lorca"
"log"
"os"
"os/signal"
)
var (
Port = 27149
URL = fmt.Sprintf("http://127.0.0.1:%d/static/index.html", Port)
)
//go:embed frontend/dist
var FS embed.FS
func main() {
for i := 1; i < 1; i++ {
fmt.Printf("1")
}
go v1.RunGin(Port, FS)
ui, err := lorca.New(URL, "", 800, 600)
if err != nil {
log.Fatal(err)
}
signCh := make(chan os.Signal)
signal.Notify(signCh, os.Interrupt)
select {
case <-signCh:
ui.Close()
case <-ui.Done():
}
os.Exit(0)
}