2023-05-08 18:43:07 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/vugu/vugu/simplehttp"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
|
|
|
// A hackish way to insert metadata and other stuff into the head tag.
|
|
|
|
simplehttp.DefaultStaticData["MetaTags"] = map[string]string{"viewport": "width=device-width, initial-scale=1"}
|
|
|
|
simplehttp.DefaultStaticData["Title"] = "D3vugu-components examples"
|
2023-05-18 11:55:48 +00:00
|
|
|
simplehttp.DefaultStaticData["CSSFiles"] = []string{"/static/css/d3c-theme-base.css"}
|
2023-05-08 18:43:07 +00:00
|
|
|
|
|
|
|
wd, _ := os.Getwd()
|
|
|
|
uiDir := filepath.Join(wd)
|
|
|
|
l := ":8875"
|
|
|
|
log.Printf("Starting HTTP Server at %q", l)
|
|
|
|
h := simplehttp.New(uiDir, true)
|
|
|
|
http.Handle("/", h)
|
|
|
|
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir(filepath.Join(uiDir, "static")))))
|
|
|
|
|
|
|
|
log.Fatal(http.ListenAndServe(l, nil))
|
|
|
|
}
|