-
Notifications
You must be signed in to change notification settings - Fork 0
/
http_server.go
49 lines (41 loc) · 1.14 KB
/
http_server.go
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
43
44
45
46
47
48
49
//go:build !wasm
// +build !wasm
package main
import (
"log"
"net/http"
"swapp/pages"
"github.com/maxence-charriere/go-app/v9/pkg/app"
)
func initWASM() {
app.Route("/", &pages.WelcomePage{})
//app.Route("/login", &pages.LoginPage{})
app.Route("/users", &pages.UsersPage{})
app.Route("/map", &pages.MapPage{})
app.Route("/dish", &pages.DishPage{})
app.Route("/depots", &pages.DepotPage{})
app.Route("/domains", &pages.DomainsPage{})
app.Route("/nodes", &pages.NodesPage{})
app.Route("/news", &pages.NewsPage{})
app.RunWhenOnBrowser()
}
func initServer() {
http.Handle("/", &app.Handler{
Name: "swAPP",
Description: "sakalWeb progressive web app",
Icon: app.Icon{
Default: "/web/logo_284.png",
AppleTouch: "/web/apple-touch-icon.png",
},
Styles: []string{
"https://cdn.jsdelivr.net/npm/beercss@3.3.3/dist/cdn/beer.min.css",
},
Scripts: []string{
"https://cdn.jsdelivr.net/npm/beercss@3.3.3/dist/cdn/beer.min.js",
"https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.0.1/dist/cdn/material-dynamic-colors.min.js",
},
})
if err := http.ListenAndServe(":8080", nil); err != nil {
log.Fatal(err)
}
}