Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ import (
)

func main() {
// Initialize i18n system
if err := i18n.Init(); err != nil {
log.Fatalf("Failed to initialize i18n: %v", err)
}

http.HandleFunc("/", handler.DynamicHandler)
// bij /link redirect nr chromewebstore
http.HandleFunc("/link", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r,
"https://chromewebstore.google.com/detail/smartschool++/bdhficnphioomdjhdfbhdepjgggekodf",
http.StatusFound,
)
})

http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "content/static/favicon.ico")
})
Expand All @@ -25,6 +31,8 @@ func main() {
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./content/static"))))
http.Handle("/media/", http.StripPrefix("/media/", http.FileServer(http.Dir("./content/media"))))

http.HandleFunc("/", handler.DynamicHandler)

port := "9000"
fmt.Println("Starting Smartschool++ HTTP server on port: " + port)
if err := http.ListenAndServe(":"+port, nil); err != nil {
Expand Down
Binary file modified smppmainhttpserver.exe
100644 → 100755
Binary file not shown.