proper-website-2/main.go

38 lines
805 B
Go
Raw Normal View History

2022-03-01 14:36:04 +01:00
package main
import (
"log"
"net/http"
2022-03-01 15:50:53 +01:00
"git.home.dutchellie.nl/DutchEllie/proper-website-2/components"
2022-03-01 14:36:04 +01:00
"github.com/maxence-charriere/go-app/v9/pkg/app"
)
func main() {
2022-03-01 15:50:53 +01:00
homepage := components.NewHomepage()
app.Route("/", homepage)
2022-03-01 14:36:04 +01:00
2022-03-01 15:50:53 +01:00
// This is executed on the client side only.
// It handles client side stuff
// It exits immediately on the server side
2022-03-01 14:36:04 +01:00
app.RunWhenOnBrowser()
http.Handle("/", &app.Handler{
2022-03-01 14:51:45 +01:00
Name: "Internetica Galactica",
Description: "A 1990's style PWA!",
2022-03-01 15:50:53 +01:00
Styles: []string{
"/web/static/style.css",
"/web/static/anisha.css",
},
CacheableResources: []string{
"/web/static/style.css",
"/web/static/anisha.css",
"/web/static/images/background_star.gif",
},
2022-03-01 14:36:04 +01:00
})
if err := http.ListenAndServe(":8000", nil); err != nil {
log.Fatal(err)
}
}