// Serve the web frontend on the given port.
Serve the web frontend on the given port.
// Serve the web frontend on the given port .
func Serve(port int, bAddr string, bPath string, wg *sync.WaitGroup) {
	defer wg.Done()
	baseAddr = bAddr
	basePath = bPath
	initTemplates()
	log.WithFields(log.Fields{
		"Port": port,
		"BaseAddr": baseAddr,
		"BasePath": basePath,
	}).Info("Launching web frontend")
	http.HandleFunc(setpath("/"), webRootHandler)
	log.Debugf("Set handler function for location %s", setpath("/"))
	http.HandleFunc(setpath("/file/"), fileDownloadHandler)
	log.Debugf("Set handler function for location %s", setpath("/file/"))
	http.Handle(	
		setpath("/static/"), http.StripPrefix(setpath("/static/"), 
		http.FileServer(http.Dir("www/static/"))),
	)
	log.Debugf("Set handler function for location %s", setpath("/static/"))
	log.WithFields(log.Fields{
		"Base Addr": baseAddr,
		"Base Path": basePath,
		"Port": port,
	}).Info("Serving...")
	log.Error(http.ListenAndServe(":" + strconv.Itoa(port), nil))
}
func Serve ( port int , bAddr string , bPath string , wg * sync . WaitGroup ) { defer wg . Done ( ) baseAddr = bAddr basePath = bPath initTemplates ( ) log . WithFields ( log . Fields { " " : port , " " : baseAddr , " " : basePath , } ) . Info ( " " ) http . HandleFunc ( setpath ( " " ) , webRootHandler ) log . Debugf ( " " , setpath ( " " ) ) http . HandleFunc ( setpath ( " " ) , fileDownloadHandler ) log . Debugf ( " " , setpath ( " " ) ) http . Handle ( setpath ( " " ) , http . StripPrefix ( setpath ( " " ) , http . FileServer ( http . Dir ( " " ) ) ) , ) log . Debugf ( " " , setpath ( " " ) ) log . WithFields ( log . Fields { " " : baseAddr , " " : basePath , " " : port , } ) . Info ( " " ) log . Error ( http . ListenAndServe ( " " + strconv . Itoa ( port ) , nil ) ) }
Serve the web frontend on the given port.
Serve the web frontend on the given port .
/* Cache essential variables and templates */ /* Set request Handlers */ // Serve static files from the web directory. /* Start the Server */