sermoni

"Service monitor" / cronjob status service
Log | Files | Refs

html_dev.go (435B)


      1 // +build !PRODUCTION
      2 
      3 package http
      4 
      5 import "io/ioutil"
      6 
      7 // PRODUCTION is set to false because secure cookies can't be used in dev mode
      8 const PRODUCTION = false
      9 
     10 // In production mode, the website is embedded in (generated) code
     11 // In dev mode it's more useful to read the html file on every request
     12 func getWebsite() []byte {
     13 	htmlData, err := ioutil.ReadFile("ui/dist/index.html")
     14 	if err != nil {
     15 		panic(err)
     16 	}
     17 	return htmlData
     18 }