2017-05-16 13:39:59 +02:00
|
|
|
package main
|
|
|
|
|
2017-05-16 15:22:40 +02:00
|
|
|
import (
|
|
|
|
"github.com/GeertJohan/go.rice"
|
|
|
|
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
)
|
2017-05-16 13:39:59 +02:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
printBanner()
|
2017-05-16 15:22:40 +02:00
|
|
|
|
|
|
|
// Load configuration
|
|
|
|
|
|
|
|
// Serve static assets
|
|
|
|
assets := rice.MustFindBox("../client/build")
|
|
|
|
assetsHandler := http.StripPrefix(
|
|
|
|
"/static/",
|
|
|
|
http.FileServer(assets.HTTPBox()))
|
|
|
|
|
|
|
|
index, err := assets.String("index.html")
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Println(index)
|
|
|
|
|
|
|
|
http.Handle("/static/", assetsHandler)
|
|
|
|
|
|
|
|
// Start http server
|
|
|
|
http.ListenAndServe(":7340", nil)
|
2017-05-16 13:39:59 +02:00
|
|
|
}
|