Update asset embedding.
This commit is contained in:
parent
c690c5b420
commit
fd57f1b6ca
7
Makefile
7
Makefile
@ -1,13 +1,12 @@
|
|||||||
|
|
||||||
build: generate
|
build: generate
|
||||||
go build -tags "embed"
|
go build
|
||||||
|
|
||||||
generate:
|
generate:
|
||||||
cd src/assettemplates/ && yaber --pkg "assettemplates" -strip "../../" ../../templates/
|
yaber -out src/assets.go templates/ static/
|
||||||
cd src/assetstatic && yaber --pkg "assetstatic" -strip "../../" ../../static/
|
|
||||||
|
|
||||||
test_run:
|
test_run:
|
||||||
go run ss13.go -verbose run
|
go run ss13.go -verbose run
|
||||||
|
|
||||||
test_run_embed:
|
test_run_embed:
|
||||||
go run -tags "embed" ss13.go -verbose run
|
go run ss13.go -verbose run
|
||||||
|
|||||||
@ -1,19 +1,78 @@
|
|||||||
// +build embed
|
//go:generate yaber -out src/assets.go templates/ static/
|
||||||
|
|
||||||
// Automagically generated by yaber v0.2 (https://github.com/lmas/yaber),
|
// Code generated by yaber v0.3 (https://github.com/lmas/yaber)
|
||||||
// please avoid editting this file as it might be regenerated again.
|
// DO NOT EDIT.
|
||||||
|
|
||||||
package assetstatic
|
package ss13
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var _useRawAssets bool = false
|
||||||
|
|
||||||
|
func SetRawAssets(b bool) {
|
||||||
|
_useRawAssets = b
|
||||||
|
}
|
||||||
|
|
||||||
func Asset(path string) ([]byte, error) {
|
func Asset(path string) ([]byte, error) {
|
||||||
|
if _useRawAssets {
|
||||||
|
return GetRaw(path)
|
||||||
|
}
|
||||||
|
return GetEmbedded(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
func AssetDir(dir string) (map[string][]byte, error) {
|
||||||
|
if _useRawAssets {
|
||||||
|
return GetRawDir(dir)
|
||||||
|
}
|
||||||
|
return GetEmbeddedDir(dir)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetRaw(path string) ([]byte, error) {
|
||||||
|
return ioutil.ReadFile(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetRawDir(dir string) (map[string][]byte, error) {
|
||||||
|
list := make(map[string][]byte)
|
||||||
|
dirs := []string{dir}
|
||||||
|
|
||||||
|
for len(dirs) > 0 {
|
||||||
|
d := dirs[0]
|
||||||
|
dirs = dirs[1:]
|
||||||
|
files, e := ioutil.ReadDir(d)
|
||||||
|
if e != nil {
|
||||||
|
return nil, e
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, f := range files {
|
||||||
|
fpath := filepath.Join(d, f.Name())
|
||||||
|
|
||||||
|
if f.IsDir() {
|
||||||
|
dirs = append(dirs, fpath)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if !f.Mode().IsRegular() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
fbody, e := ioutil.ReadFile(fpath)
|
||||||
|
if e != nil {
|
||||||
|
return nil, e
|
||||||
|
}
|
||||||
|
list[fpath] = fbody
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetEmbedded(path string) ([]byte, error) {
|
||||||
body, ok := _rawAssets[path]
|
body, ok := _rawAssets[path]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, os.ErrNotExist
|
return nil, os.ErrNotExist
|
||||||
@ -21,7 +80,7 @@ func Asset(path string) ([]byte, error) {
|
|||||||
return decompress(body)
|
return decompress(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
func AssetDir(dir string) (map[string][]byte, error) {
|
func GetEmbeddedDir(dir string) (map[string][]byte, error) {
|
||||||
var e error
|
var e error
|
||||||
files := make(map[string][]byte)
|
files := make(map[string][]byte)
|
||||||
for path, body := range _rawAssets {
|
for path, body := range _rawAssets {
|
||||||
@ -39,6 +98,9 @@ func decompress(data []byte) ([]byte, error) {
|
|||||||
buf := bytes.NewBuffer(data)
|
buf := bytes.NewBuffer(data)
|
||||||
gr, e := gzip.NewReader(buf)
|
gr, e := gzip.NewReader(buf)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
|
if e == io.EOF {
|
||||||
|
return []byte{}, nil
|
||||||
|
}
|
||||||
return nil, e
|
return nil, e
|
||||||
}
|
}
|
||||||
defer gr.Close()
|
defer gr.Close()
|
||||||
@ -76,4 +138,14 @@ var _rawAssets = map[string][]byte{
|
|||||||
"static/js/utils.js": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\x9c\x94Qo\x9b0\x10\xc7\xdf\xf3)Nl\x0fF0\x9aT\xeaK\xaa<\xad\x9a\xb6\x87>m\x93VMS\xe4\x85#X56\xb2\x8f4Y\x95\xef>\x1b0\x81,\xea\xaa\xe6!2\xbe\xdf\xdd\xf9\xfe\xfe\u00ech\u0506\x84VP\xf3\x9c\xed\xb8l0~\x9e\x81\xfbY2\xb0\x82\xafd\x84\xda\xf6\x81\xdb6 \n`.\x98IT[*a\xb5\x82E\f]\xce)/\x9aG\x90\xf8u\x97sl\xff\rRcT\xb7{\x9c\x9dZ\x17\xdaT\x9c\xd69'd$\xaap\x82\x1d7@\xd6\x15\xf3{\xd9\x16\xe9S#\xe5\x03r\xc3bW;\xfa\x10u\xb5\xaf\xae Y\xc0o\xdc\xf0\xc6\"P),\x14\xcd\xe6\x11\r\xe4\xb8\x119\xe6@\u0685\xe1\x0f\x1a\rB\xe5\xb8\xc7<\x85FI\xf1\xe8qt\u01f2\x94\xb5\xa5\\\xb7d\xd5*\x11Z~\xff\xf6\xf1^+*Y\x9c,&]/\xa2w~\x82\xb8\xe5\xe0%\xee\xb3n\x8c\xed\xc1\xe5K\xe0\xbdP\ra@\xc1\xed\xf4t/%\u0649\x90\xb6\xd4Ok\xd2Z\x92\xa8Ye\xb7)\xecS8\xf4r\xbeg\u047b>\x16\xc5\xc3ue%U\u04b3\xa3\xad\x8d\xb5\xec\x99t\xbd\x84C\n\x12\vZ\xc2\xfe8\x8a\x17<\xc7/\x8a]\xcf\xe7\xf1\xf4\"K'\xf7\xd0\xffR\xdb\xcc\x13\xec,\xab\x96\xfc\x80\u01ae\x9d\x05B.\xeePQ\n\xb5\xb6)\b\xc2*\x18\xcc{o\xfc<\xd8\xc4I\xe6\x8c\xe2C\x99\xb3\x11\xaf\xb5P\xf4s\xfe\xebvB\xf5\x8d\xfe\x05\x17g\xa0/g\x89W\xb5C\xc7\xe6T\xf8\x04w\x83K\xe3S\xd2D\xf8\xd0\xc6\xdfXXs\x02\xffB\f\x85\xbb\xb1\xb2\x9ao\xf1Gr3zzHn\xfa\xbaG@\xe9\f}\x1at\xaanx\xb1.)\xf9V\x19_%\xd0\xfff\x8d\u01b3\x8d'{\xfb\\\x83l\x03v\xf6\x99p\x13\xbaC\xb7V\v\xa83\x9b.\n\x8b\x14JN\xce\xed\xb1V\x98\xcc\xfb\xbb[9\xc7'\u05dd\xa5\xff\x02\x00\x00\xff\xff\x01\x00\x00\xff\xff\x81\xb3\u0256\x17\x05\x00\x00"),
|
"static/js/utils.js": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\x9c\x94Qo\x9b0\x10\xc7\xdf\xf3)Nl\x0fF0\x9aT\xeaK\xaa<\xad\x9a\xb6\x87>m\x93VMS\xe4\x85#X56\xb2\x8f4Y\x95\xef>\x1b0\x81,\xea\xaa\xe6!2\xbe\xdf\xdd\xf9\xfe\xfe\u00ech\u0506\x84VP\xf3\x9c\xed\xb8l0~\x9e\x81\xfbY2\xb0\x82\xafd\x84\xda\xf6\x81\xdb6 \n`.\x98IT[*a\xb5\x82E\f]\xce)/\x9aG\x90\xf8u\x97sl\xff\rRcT\xb7{\x9c\x9dZ\x17\xdaT\x9c\xd69'd$\xaap\x82\x1d7@\xd6\x15\xf3{\xd9\x16\xe9S#\xe5\x03r\xc3bW;\xfa\x10u\xb5\xaf\xae Y\xc0o\xdc\xf0\xc6\"P),\x14\xcd\xe6\x11\r\xe4\xb8\x119\xe6@\u0685\xe1\x0f\x1a\rB\xe5\xb8\xc7<\x85FI\xf1\xe8qt\u01f2\x94\xb5\xa5\\\xb7d\xd5*\x11Z~\xff\xf6\xf1^+*Y\x9c,&]/\xa2w~\x82\xb8\xe5\xe0%\xee\xb3n\x8c\xed\xc1\xe5K\xe0\xbdP\ra@\xc1\xed\xf4t/%\u0649\x90\xb6\xd4Ok\xd2Z\x92\xa8Ye\xb7)\xecS8\xf4r\xbeg\u047b>\x16\xc5\xc3ue%U\u04b3\xa3\xad\x8d\xb5\xec\x99t\xbd\x84C\n\x12\vZ\xc2\xfe8\x8a\x17<\xc7/\x8a]\xcf\xe7\xf1\xf4\"K'\xf7\xd0\xffR\xdb\xcc\x13\xec,\xab\x96\xfc\x80\u01ae\x9d\x05B.\xeePQ\n\xb5\xb6)\b\xc2*\x18\xcc{o\xfc<\xd8\xc4I\xe6\x8c\xe2C\x99\xb3\x11\xaf\xb5P\xf4s\xfe\xebvB\xf5\x8d\xfe\x05\x17g\xa0/g\x89W\xb5C\xc7\xe6T\xf8\x04w\x83K\xe3S\xd2D\xf8\xd0\xc6\xdfXXs\x02\xffB\f\x85\xbb\xb1\xb2\x9ao\xf1Gr3zzHn\xfa\xbaG@\xe9\f}\x1at\xaanx\xb1.)\xf9V\x19_%\xd0\xfff\x8d\u01b3\x8d'{\xfb\\\x83l\x03v\xf6\x99p\x13\xbaC\xb7V\v\xa83\x9b.\n\x8b\x14JN\xce\xed\xb1V\x98\xcc\xfb\xbb[9\xc7'\u05dd\xa5\xff\x02\x00\x00\xff\xff\x01\x00\x00\xff\xff\x81\xb3\u0256\x17\x05\x00\x00"),
|
||||||
|
|
||||||
"static/robots.txt": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xe2\n-N-\xd2MLO\xcd+\xb1R\xd0\xe2r\xc9,N\xcc\xc9\xc9/\xb7R\xd0/.I,\xc9L\xd6\xe7\xe2\x02\x00\x00\x00\xff\xff\x01\x00\x00\xff\xff\x90\xbc\x8bX#\x00\x00\x00"),
|
"static/robots.txt": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xe2\n-N-\xd2MLO\xcd+\xb1R\xd0\xe2r\xc9,N\xcc\xc9\xc9/\xb7R\xd0/.I,\xc9L\xd6\xe7\xe2\x02\x00\x00\x00\xff\xff\x01\x00\x00\xff\xff\x90\xbc\x8bX#\x00\x00\x00"),
|
||||||
|
|
||||||
|
"templates/base.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\x8cTOo\xdb \x14\xbf\xf7SP&\xed\x16\xa3\xa8\u04b4u$R\xd7N\xdb-\x93\xd2\xcbN\x15\xc6\xcf\x01\xcd\x06\v\x9e\x9dF^\xbe\xfb\x00'\x8d\x93%j8\x18\xc3\xe3\xf7\xfe\xfe\xde\xeb\xfb\x02Jm\x80P\x05\xa2\x00G\xb7\xdb\x1b~\xfb\xb4x|\xfe\xfd\xeb;QXW\xf3\x1b>l$,\x1e_\r\xbf\xe9X\x03\n\"\x95p\x1epF[,'\x9f\xe9H\\i\xf3\x87(\a\xe5\x8c2\x8f\x02\xb5d\xd2{\x96[\x8b\x1e\x9dh\xb2Z\x9b,\xdcP\u281aQ\x8f\x9b\n\xbc\x02\xc0+\x94\xa4\xc7\u05c1\a\xb9\xb2\x0ee\x8bDKk\xe8\x89\xc2Rt\xf1:\v\x9f1\x1a5Vp8\xc7\xd5\xf7Y#V\x90$\xdb-\xf9K\x96\xcb\xe9\x1d\xf9\xd9\xe6\a\x14\x1b\xc18\x1b26\x1cr[lF\ua1d4\x1f\xeb\xe7FtD\x173\x1a\xf6\\8z,M/\xda\xea\xff\xcb]\xb0s.\xf6\x91\xd1\xf9\xde3\xce\u011c\xb3 \xbc\x0e\x05\xae\x03\xe7\xdf\x01\xddN&\xc7\xc0\x98H\x1f\xd0q{\xc3N&\xd7\xd8\x14\xb9mC\xd1\x1e\xe2\xf6\xae\xafDV\xc2\xfb\x19-t\xa7#_\xaf\x8dL!6\xf7\x8c\xad\xd7\xeb,\xdfXSd\xd2\xd6l%j\xf0\f^E\xd1M\x99o\x84\x84\xc4\ak\xa6wg\x12?^\u07e2\x8e\xf3V/F\xc0\xd9i\xe58\vU\x1e\x11\x82\x9d2\x82{\x90\u045f\u0108@P\x04\x13\xe9\xdd\xf7`\x8a\u04297\x87\xf6-CO\r\xed{\u0436\x03\x8f\xd4\r\xaf\x92\xb6\xdc\"\xda\xfae\x87;\xf1\xab99\x87r?/\x9e\x16\xf7\xc4X$\xbeu@R\xd1\b* \xd26\x1b\xa7W*\b\xb0-K\xb2V`H\t(\x956+\x02\xaf\x98\x91B\xa0\xc8\u0391\x81\x87\xa4\x9b}I+(\xf1B\xda\x1f\xdfl|\xfc0\xfd\xf4\xe5kh\xc3\r\b7\x8av\xbc\x1e2\xb2\xec\xc0xo\u0359\"D\x93\xbb\x86\xbc\xe8J\xb2u\xc1\x97\xa5m\x9d\x8ca\x17!\vx\x9e\x03c\xd6\xf9@\xbb\x95F\xd5\xe6\x89sU-\xc2\xf0\xf2\u04fb\x17\x0ft\xfe#\t\"g\xb2\x8b\xae\x1e\xdf5c\xbe\f\xd5\u06cf\x9aa\xbc\x04\x16\xa5y\xbd'\xc9?\x00\x00\x00\xff\xff\x01\x00\x00\xff\xff\xec\x1f]&\xe3\x05\x00\x00"),
|
||||||
|
|
||||||
|
"templates/page_404.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xffL\xcc1\x0e\xc20\fF\xe1=\xa7\xf8\xc9\u0082\xe0\x02\xa5\x97\xe0\x04V\xea\xd0J\u0176\\3TU\xeeN\u063a=\xbd\xe1;\x8e\xe0\x8f\xad\x14\x8c<3M\xec\x19\xf7\xd6R\x1a\fe\xa5m{\xe6\xc2\x12}\x8f/u\xdfQ\u0202\x16\xb9\xf5\x90k\xa0.2!f\n\x18\xbd\x19U\x1d\xbb~/\xc3\xc3\u0194\xcexU\xfd+\x9d\xfe\x01\x00\x00\xff\xff\x01\x00\x00\xff\xffC*I\xc7s\x00\x00\x00"),
|
||||||
|
|
||||||
|
"templates/page_about.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xac\x93?\x8f\xdb<\f\xc6w\u007f\n\xc2\xf3!F.\xef\xf4\xc25\x90\xa2@\u0461S\xba\x17\xb4E\xc7\xc2\u0262 \xd2I\x83\xc3}\xf7R>\xb7\xb9C\x97\x0e]\x8cD\xfc\xf3<\xfcQz~V\x9aS@%\xa8'BG\xb9\x86\xdd\xcbKU\xb5\u04fe;\xf6\xbch\xdb\u062f\xaaM\xdd\x11\x84\xf2\x852LK\x0f\x8e\x9c\x1f\xac\u02812\x9cN\xfb\x03`t\x90X\xc4\xf7\xe1\x06\b=\xa9Zn&k>\xd0LQa\xe4\f:\x91\u054e\xb8\x04\xad\xb6v\t\xcf\x04\xa8\xd0\"L\x99\xc6\x0f\xf5\xa4\x9a\xfeo\x9a\xeb\xf5\xba\xebo\x1c\xddn\xe0\xb99\xe3L\xd2\xd0\x0ft\x97}#\xc9z\x8a\xa2z\x8e\xfbC\xdd},im\x83\u076emRW\x15\xb7_9\x13\xf88\xf2jl\\B\x00\xe1%\x0f\x04\x03;\xfb`4\x8bfi\xb1(\xc7\ua778\x98\xfa\u066b\u0379J\x87\x19\xa5\x11\xd9\x1f\xbe\v\xd5\xdd\xe75\xf0Vlz\xec>\xa1\"\x9c\xd6\xfeb\xc0\x1eW`\xdf\u02ac%\xb0\x88q*\xd3\xcf,\n<\xae\x14Z\xd1\xcc\xf1\u0725\xa5\x0f~h\x9b\xed\xef\x06Y\xc0\v\u02101\x95\xd2\xccs\xb5\xd6\xfc\x03D+\xef;\xa7\xa3\x81\xf9m%\xfb\x8b\xed\xf4\x0f/\x0f+C\xe1\x99\xe0\u056d\x11\xa3rj\x88{\xf2\xf1l\x8b\x0f\x81\\\xe5|\xa6Am\xffe\xd82\xfa]\xe7\xcb\b7^\xe0\xcaKp\x10\xfc\x13\x95\x8b\xf3K\x18\x9d+\u047c\t\xde\rXN\x99{3fu\xa2\x0fU1\x83\xc3@I\u07e9\x03\x96\xeb\n\xff\x81z\xe3`\x96a\xb2\x96\x0f\x90\x02\xa1\x10p\xa2\b\xf8\u05cbn\xbc\xc8b8#]\xeb\xce>\xd6ux\"]\tr,\xae\xaa5\x034\xa3\x05r9\xdcZ\xbd\xce\xfc\xf6e\x8d\xcc\xf6\x18\xea\xf2\xae~\x02\x00\x00\xff\xff\x01\x00\x00\xff\xff\xb50\xb0\xe4q\x03\x00\x00"),
|
||||||
|
|
||||||
|
"templates/page_index.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xa4Vao\x9b<\x10\xfe\xde_q/o\xa5&R\x03\u06f4OY\xc2T\xad\xd2\xd6O\x9b\xd4\xee\a\xb8p$N\x89\x9d\xd9&\x19B\xfc\xf7\x9d\x81\x14HL\xba,|H\xcc\xf9\xfc\xf8\xeey\u0387\x8b\xc2\xe0z\x932\x83\xe0-\x91\u0168<\xf0\xcb\xf2\n\xe8\x99\x19\xf6\x9c\"\xf0x\xeeiT[T\u0683(eZ\u03fdz\xa6\xfa\x9d,%M\xd5c-\x95!\x84\xb0Z^CX\xd0\xf6\xbd\xb6\xa9\xbe\xa1q\fgz\xc3D8\v\x9a?\xb2\f\xbb\x81\xe1&\u0179\xf7%S\n\x85\x01)R.\x10(\x93\xdc\xc6\x19\x92\xdd?\x0f\u93b2`\v<B\xba\xdb.\xfe\x12)|\xacX\x1at&K's;\xdf\xe3ff\x9ee\x9c\xf7\x97\x14\x85b\x82\x82\xf2\x1b\x01\x1ae\xfa.<\x01\xff\x89\xaf\xf1A\u007fUHJ*\xf8\xf0\xd1\xe1H\xbc\xef\xe5\x8b-hW\xa7\xc3|\x9c\x13\xd5d\x97\xb2\xefIb\xb9\x9a\u008ei\x10\u0480F\x14\x10g\x8a\x8b\x05Pv@\xbb\x19\xd8!\xbe\xf8\xaf\x95\xb3H\xf3\u0352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00\x00\xff\xff\xb0\x8c\x84&h\t\x00\x00"),
|
||||||
|
|
||||||
|
"templates/page_server.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xecX_o\xdb6\x10\u007f\xef\xa78py\x88\x01G^\xd7\r\x03\x12Y@\xb1\x01\xed\x80\xec\x0f\x90\x16{\b\x82\x80\xb6(\x89\tEj$e\xc7S\xf5\xddw\x94dK\xb2%\xe7O\x03l\x0f#\xd0B\xbe;\xfe\ue3bf\xbb#\x91\xa2\xb0,\xcd\x04\xb5\fH\xc2h\xc84\x01\xaf,\xdf\x00.?y\x1b\x14\x85g\x98^1\xed}\xe2V\xb0\xb2\xf4g(}S\xeb),\x055fN\x16V\x02\xfe;\vYDsa\t\xb4\xdb>\u0414}\xd6\x02\xbe\x18\x1a\xb1\xdbD\xb3\b\xca\x124\x13s\"U\xa4\x84Pk\x12\\\xd2\\.\x13\x88\xd1\u059f\u0460B/\n\x1e\xc1\x16\xe5\x8a[\x87\xd2\x04\xf6\x88s\xe7dN\xda\x10v\x9b\u027e\u07cf*e\x19\x8d\xbbN\x990\xac\xebf\x91[\xab\u462f\xe07\x05\xc9\x0e\xa4\xb6\xdd!\xc9\x10\x81\x9a\x93|\x17\\Yjs\x83\xc7\xf7.\u0621\x17\x05t\x92\xfc\xc4S\xf6\x8b\xf9\xa0\x19\xb2\xa1\xe1\xbb\xef\xb74d\xc0\xc39\xa9\x8dnM\x05C\xb6\x01\xd5?oU\x14\t.\x19i\xa1}\x93Q\t\u05916'\xbf\xd7\xeasXS\x03RY0\x8cI\bs\xcde\f6a\x80`\x16\u058c\xdd{;\xe4Xl\xb2\x84/1\xf7\xdd\u05d9f\xa9Z\xb13\xc3cI\x02\u007f\xe6\\\xf4\x92q\x877\x9e\xd1\xdbg$\x94\xcb{\xa9\xd6r,\xa1\u03f5\xfa\x91\x84B\xba9\x9e\xcf_93\x96\xe3\xc7XF\x9djx\x12\r\xf2(\v\xb2%a0\xdeD\xe5\xfax\xc0\xea~<\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92o\xba\x1d1\x85k\x17\xcd\xcdt/L\xb7\x1e\xe8\x037\xe7\x03\n\xb7R\x15\xe2\x05W\xdd-d:h\xe1T\u007f+w\r\x92\x85Vk\xec\xfb\x01\xc3\xf2P\xe4\x86\xee\xa8[\x93\xa8\xf59X\x9d\xb3a\xa7\x11\x17bL?\xe0+\xd6<\x1csU\xdd\"n\xf6\x1c\xf3\xb7P\x1a_\xd2\u007f\xf2\xd0&\xe7\xf0\xed\xa3>\xcb\xc9\u015b\x17\x94Cw\x18\xbd~=\xf4F\xdd\xff\x05\xf1\xdf(\x88\xfdz\u8346\xfa\n\xa9+\xe1g\xba\xf9\xeai\xd0\\I_\xcb};;\x9fF\xec\x82\xea\x17\xf3\x8a{\xb7\x87\xec\xfd\xf8\u00f0\r\x15\xf8\x82vq\xe1\xab\xe7\xa9\xc5\xf6\xaf\x17\xc0\xc9\u0784\x9ex\v.\xc3S\xe2\xe8\xaa\x1f\xb6S\xa8_\xc0\xe6\x96\xda\xed\v}rq\x00\xd2k\xeb\x17\xa3t\xca\xe3\x18\xc6!@\xd9|\xb77h\xf7/\x10\x91R\x8e\x12\xac\xd1\u007f\x00\x00\x00\xff\xff\x01\x00\x00\xff\xff\xd3\xcc\x14I\x98\x10\x00\x00"),
|
||||||
}
|
}
|
||||||
@ -1,48 +0,0 @@
|
|||||||
// +build !embed
|
|
||||||
|
|
||||||
// Automagically generated by yaber v0.2 (https://github.com/lmas/yaber),
|
|
||||||
// please avoid editting this file as it might be regenerated again.
|
|
||||||
|
|
||||||
package assetstatic
|
|
||||||
|
|
||||||
import (
|
|
||||||
"io/ioutil"
|
|
||||||
"path/filepath"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Asset(path string) ([]byte, error) {
|
|
||||||
return ioutil.ReadFile(path)
|
|
||||||
}
|
|
||||||
|
|
||||||
func AssetDir(dir string) (map[string][]byte, error) {
|
|
||||||
list := make(map[string][]byte)
|
|
||||||
dirs := []string{dir}
|
|
||||||
|
|
||||||
for len(dirs) > 0 {
|
|
||||||
d := dirs[0]
|
|
||||||
dirs = dirs[1:]
|
|
||||||
files, e := ioutil.ReadDir(d)
|
|
||||||
if e != nil {
|
|
||||||
return nil, e
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, f := range files {
|
|
||||||
fpath := filepath.Join(d, f.Name())
|
|
||||||
|
|
||||||
if f.IsDir() {
|
|
||||||
dirs = append(dirs, fpath)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !f.Mode().IsRegular() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
fbody, e := ioutil.ReadFile(fpath)
|
|
||||||
if e != nil {
|
|
||||||
return nil, e
|
|
||||||
}
|
|
||||||
list[fpath] = fbody
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list, nil
|
|
||||||
}
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
// +build embed
|
|
||||||
|
|
||||||
// Automagically generated by yaber v0.2 (https://github.com/lmas/yaber),
|
|
||||||
// please avoid editting this file as it might be regenerated again.
|
|
||||||
|
|
||||||
package assettemplates
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"compress/gzip"
|
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Asset(path string) ([]byte, error) {
|
|
||||||
body, ok := _rawAssets[path]
|
|
||||||
if !ok {
|
|
||||||
return nil, os.ErrNotExist
|
|
||||||
}
|
|
||||||
return decompress(body)
|
|
||||||
}
|
|
||||||
|
|
||||||
func AssetDir(dir string) (map[string][]byte, error) {
|
|
||||||
var e error
|
|
||||||
files := make(map[string][]byte)
|
|
||||||
for path, body := range _rawAssets {
|
|
||||||
if strings.HasPrefix(path, dir) {
|
|
||||||
files[path], e = decompress(body)
|
|
||||||
if e != nil {
|
|
||||||
return nil, e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return files, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func decompress(data []byte) ([]byte, error) {
|
|
||||||
buf := bytes.NewBuffer(data)
|
|
||||||
gr, e := gzip.NewReader(buf)
|
|
||||||
if e != nil {
|
|
||||||
return nil, e
|
|
||||||
}
|
|
||||||
defer gr.Close()
|
|
||||||
return ioutil.ReadAll(gr)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _rawAssets = map[string][]byte{
|
|
||||||
|
|
||||||
"templates/base.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\x8cTOo\xdb \x14\xbf\xf7SP&\xed\x16\xa3\xa8\u04b4u$R\xd7N\xdb-\x93\xd2\xcbN\x15\xc6\xcf\x01\xcd\x06\v\x9e\x9dF^\xbe\xfb\x00'\x8d\x93%j8\x18\xc3\xe3\xf7\xfe\xfe\xde\xeb\xfb\x02Jm\x80P\x05\xa2\x00G\xb7\xdb\x1b~\xfb\xb4x|\xfe\xfd\xeb;QXW\xf3\x1b>l$,\x1e_\r\xbf\xe9X\x03\n\"\x95p\x1epF[,'\x9f\xe9H\\i\xf3\x87(\a\xe5\x8c2\x8f\x02\xb5d\xd2{\x96[\x8b\x1e\x9dh\xb2Z\x9b,\xdcP\u281aQ\x8f\x9b\n\xbc\x02\xc0+\x94\xa4\xc7\u05c1\a\xb9\xb2\x0ee\x8bDKk\xe8\x89\xc2Rt\xf1:\v\x9f1\x1a5Vp8\xc7\xd5\xf7Y#V\x90$\xdb-\xf9K\x96\xcb\xe9\x1d\xf9\xd9\xe6\a\x14\x1b\xc18\x1b26\x1cr[lF\ua1d4\x1f\xeb\xe7FtD\x173\x1a\xf6\\8z,M/\xda\xea\xff\xcb]\xb0s.\xf6\x91\xd1\xf9\xde3\xce\u011c\xb3 \xbc\x0e\x05\xae\x03\xe7\xdf\x01\xddN&\xc7\xc0\x98H\x1f\xd0q{\xc3N&\xd7\xd8\x14\xb9mC\xd1\x1e\xe2\xf6\xae\xafDV\xc2\xfb\x19-t\xa7#_\xaf\x8dL!6\xf7\x8c\xad\xd7\xeb,\xdfXSd\xd2\xd6l%j\xf0\f^E\xd1M\x99o\x84\x84\xc4\ak\xa6wg\x12?^\u07e2\x8e\xf3V/F\xc0\xd9i\xe58\vU\x1e\x11\x82\x9d2\x82{\x90\u045f\u0108@P\x04\x13\xe9\xdd\xf7`\x8a\u04297\x87\xf6-CO\r\xed{\u0436\x03\x8f\xd4\r\xaf\x92\xb6\xdc\"\xda\xfae\x87;\xf1\xab99\x87r?/\x9e\x16\xf7\xc4X$\xbeu@R\xd1\b* \xd26\x1b\xa7W*\b\xb0-K\xb2V`H\t(\x956+\x02\xaf\x98\x91B\xa0\xc8\u0391\x81\x87\xa4\x9b}I+(\xf1B\xda\x1f\xdfl|\xfc0\xfd\xf4\xe5kh\xc3\r\b7\x8av\xbc\x1e2\xb2\xec\xc0xo\u0359\"D\x93\xbb\x86\xbc\xe8J\xb2u\xc1\x97\xa5m\x9d\x8ca\x17!\vx\x9e\x03c\xd6\xf9@\xbb\x95F\xd5\xe6\x89sU-\xc2\xf0\xf2\u04fb\x17\x0ft\xfe#\t\"g\xb2\x8b\xae\x1e\xdf5c\xbe\f\xd5\u06cf\x9aa\xbc\x04\x16\xa5y\xbd'\xc9?\x00\x00\x00\xff\xff\x01\x00\x00\xff\xff\xec\x1f]&\xe3\x05\x00\x00"),
|
|
||||||
|
|
||||||
"templates/page_404.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xffL\xcc1\x0e\xc20\fF\xe1=\xa7\xf8\xc9\u0082\xe0\x02\xa5\x97\xe0\x04V\xea\xd0J\u0176\\3TU\xeeN\u063a=\xbd\xe1;\x8e\xe0\x8f\xad\x14\x8c<3M\xec\x19\xf7\xd6R\x1a\fe\xa5m{\xe6\xc2\x12}\x8f/u\xdfQ\u0202\x16\xb9\xf5\x90k\xa0.2!f\n\x18\xbd\x19U\x1d\xbb~/\xc3\xc3\u0194\xcexU\xfd+\x9d\xfe\x01\x00\x00\xff\xff\x01\x00\x00\xff\xffC*I\xc7s\x00\x00\x00"),
|
|
||||||
|
|
||||||
"templates/page_about.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xac\x93?\x8f\xdb<\f\xc6w\u007f\n\xc2\xf3!F.\xef\xf4\xc25\x90\xa2@\u0461S\xba\x17\xb4E\xc7\xc2\u0262 \xd2I\x83\xc3}\xf7R>\xb7\xb9C\x97\x0e]\x8cD\xfc\xf3<\xfcQz~V\x9aS@%\xa8'BG\xb9\x86\xdd\xcbKU\xb5\u04fe;\xf6\xbch\xdb\u062f\xaaM\xdd\x11\x84\xf2\x852LK\x0f\x8e\x9c\x1f\xac\u02812\x9cN\xfb\x03`t\x90X\xc4\xf7\xe1\x06\b=\xa9Zn&k>\xd0LQa\xe4\f:\x91\u054e\xb8\x04\xad\xb6v\t\xcf\x04\xa8\xd0\"L\x99\xc6\x0f\xf5\xa4\x9a\xfeo\x9a\xeb\xf5\xba\xebo\x1c\xddn\xe0\xb99\xe3L\xd2\xd0\x0ft\x97}#\xc9z\x8a\xa2z\x8e\xfbC\xdd},im\x83\u076emRW\x15\xb7_9\x13\xf88\xf2jl\\B\x00\xe1%\x0f\x04\x03;\xfb`4\x8bfi\xb1(\xc7\ua778\x98\xfa\u066b\u0379J\x87\x19\xa5\x11\xd9\x1f\xbe\v\xd5\xdd\xe75\xf0Vlz\xec>\xa1\"\x9c\xd6\xfeb\xc0\x1eW`\xdf\u02ac%\xb0\x88q*\xd3\xcf,\n<\xae\x14Z\xd1\xcc\xf1\u0725\xa5\x0f~h\x9b\xed\xef\x06Y\xc0\v\u02101\x95\xd2\xccs\xb5\xd6\xfc\x03D+\xef;\xa7\xa3\x81\xf9m%\xfb\x8b\xed\xf4\x0f/\x0f+C\xe1\x99\xe0\u056d\x11\xa3rj\x88{\xf2\xf1l\x8b\x0f\x81\\\xe5|\xa6Am\xffe\xd82\xfa]\xe7\xcb\b7^\xe0\xcaKp\x10\xfc\x13\x95\x8b\xf3K\x18\x9d+\u047c\t\xde\rXN\x99{3fu\xa2\x0fU1\x83\xc3@I\u07e9\x03\x96\xeb\n\xff\x81z\xe3`\x96a\xb2\x96\x0f\x90\x02\xa1\x10p\xa2\b\xf8\u05cbn\xbc\xc8b8#]\xeb\xce>\xd6ux\"]\tr,\xae\xaa5\x034\xa3\x05r9\xdcZ\xbd\xce\xfc\xf6e\x8d\xcc\xf6\x18\xea\xf2\xae~\x02\x00\x00\xff\xff\x01\x00\x00\xff\xff\xb50\xb0\xe4q\x03\x00\x00"),
|
|
||||||
|
|
||||||
"templates/page_index.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xa4Vao\x9b<\x10\xfe\xde_q/o\xa5&R\x03\u06f4OY\xc2T\xad\xd2\xd6O\x9b\xd4\xee\a\xb8p$N\x89\x9d\xd9&\x19B\xfc\xf7\x9d\x81\x14HL\xba,|H\xcc\xf9\xfc\xf8\xeey\u0387\x8b\xc2\xe0z\x932\x83\xe0-\x91\u0168<\xf0\xcb\xf2\n\xe8\x99\x19\xf6\x9c\"\xf0x\xeeiT[T\u0683(eZ\u03fdz\xa6\xfa\x9d,%M\xd5c-\x95!\x84\xb0Z^CX\xd0\xf6\xbd\xb6\xa9\xbe\xa1q\fgz\xc3D8\v\x9a?\xb2\f\xbb\x81\xe1&\u0179\xf7%S\n\x85\x01)R.\x10(\x93\xdc\xc6\x19\x92\xdd?\x0f\u93b2`\v<B\xba\xdb.\xfe\x12)|\xacX\x1at&K's;\xdf\xe3ff\x9ee\x9c\xf7\x97\x14\x85b\x82\x82\xf2\x1b\x01\x1ae\xfa.<\x01\xff\x89\xaf\xf1A\u007fUHJ*\xf8\xf0\xd1\xe1H\xbc\xef\xe5\x8b-hW\xa7\xc3|\x9c\x13\xd5d\x97\xb2\xefIb\xb9\x9a\u008ei\x10\u0480F\x14\x10g\x8a\x8b\x05Pv@\xbb\x19\xd8!\xbe\xf8\xaf\x95\xb3H\xf3\u0352GR\xc0\xebh\xa2pM54\xd1|!\xbc\xbd\xfe\xee\u041c\x02\x14\x05\xa6\x9a\xea\xf4\x88\x86\xf7\xa7Y\xd81%(\u048bi\xf8)^\x84\u07097h\x88Y~\x9a\x85_\x19j\xc3i\xf0\xef<@E\x84;\xeb\x8b\xc5\x16\xad\xd6\xce\x04\x97\x92\xce\xdc\xc9\f\xe5\xcb%\x1a\x8b\u0611X\x93\xc3[\xed\xa0(\xfc\x1f\xf5\xb8\xf1(K\xf7>\axCM\xa1\u0163\xf6\xf0\x06\xd6\t~\x19,\x15&s/\xa8\x8fw@\xb0\x0f\xf7ei\xff\x9fl\x00e9P\x9c--{\xc7\xe1M\x02v\x0e\xd1\xfd&U\xefa\xab\xea\u0722\xfa|\x9a\x93G\xa9T~K\xa7\x05\x9a\xce\xf6\xdfPs=\x8e\xa6W\b\xb4\xacm\x9b\xf4b?C\xe1U\xfd\xa6#\xc57\x06L\xbe!)\r\xfe6\xc1\x8amYm\xf5@\xab\xc82o\x98\xe1Q\xb0\xd2\xc1\x8a\x0e\xa0\xca\xfd5\x17\xfeJW5Z9\x86\x17`u>\x8a\xa7q\xdb\x1c\xafG\xb1\x8c\xb25\x95\xe8\u06276\x16\xe7\xa3$\x13\x91\xed\v\xa3q\xd1cb\xcb\x14\x91g\f\x1dB\rs(\x8e\xb8\x8b\xb4\xbe\xd3\xd1\x14n:aL(\xe4\x9b[\x97\xeb=\x1e\xf9\xc68\xe4\xfc\xad\xba*\x1c\xb8\xdb\u03d9\u00fd\xbeV\xe8\xa9#B\xfb\xbc\x1b\x9a\xb0O\x8d<\x85\x84Q\t\xdeB\x10\xc0\xbd\x147\xa6\xb2W\x9d\xc7R\x9ei\x88d\x9a\xad\x85\x13\xa6<\x8e\xe8\xc0T~\xea\xbd^\x8f\xbc\xff\xf7\xf7\x9dqW\xc2\u045e\xedq\xbb\xa0l\u01ad\xaa\xdd\x1bU\"\xa5\xbd\x0fQ\xb9\xfe\x01\x00\x00\xff\xff\x01\x00\x00\xff\xff\xb0\x8c\x84&h\t\x00\x00"),
|
|
||||||
|
|
||||||
"templates/page_server.html": []byte("\x1f\x8b\b\x00\x00\tn\x88\x00\xff\xecX_o\xdb6\x10\u007f\xef\xa78py\x88\x01G^\xd7\r\x03\x12Y@\xb1\x01\xed\x80\xec\x0f\x90\x16{\b\x82\x80\xb6(\x89\tEj$e\xc7S\xf5\xddw\x94dK\xb2%\xe7O\x03l\x0f#\xd0B\xbe;\xfe\ue3bf\xbb#\x91\xa2\xb0,\xcd\x04\xb5\fH\xc2h\xc84\x01\xaf,\xdf\x00.?y\x1b\x14\x85g\x98^1\xed}\xe2V\xb0\xb2\xf4g(}S\xeb),\x055fN\x16V\x02\xfe;\vYDsa\t\xb4\xdb>\u0414}\xd6\x02\xbe\x18\x1a\xb1\xdbD\xb3\b\xca\x124\x13s\"U\xa4\x84Pk\x12\\\xd2\\.\x13\x88\xd1\u059f\u0460B/\n\x1e\xc1\x16\xe5\x8a[\x87\xd2\x04\xf6\x88s\xe7dN\xda\x10v\x9b\u027e\u07cf*e\x19\x8d\xbbN\x990\xac\xebf\x91[\xab\u462f\xe07\x05\xc9\x0e\xa4\xb6\xdd!\xc9\x10\x81\x9a\x93|\x17\\Yjs\x83\xc7\xf7.\u0621\x17\x05t\x92\xfc\xc4S\xf6\x8b\xf9\xa0\x19\xb2\xa1\xe1\xbb\xef\xb74d\xc0\xc39\xa9\x8dnM\x05C\xb6\x01\xd5?oU\x14\t.\x19i\xa1}\x93Q\t\u05916'\xbf\xd7\xeasXS\x03RY0\x8cI\bs\xcde\f6a\x80`\x16\u058c\xdd{;\xe4Xl\xb2\x84/1\xf7\xdd\u05d9f\xa9Z\xb13\xc3cI\x02\u007f\xe6\\\xf4\x92q\x877\x9e\xd1\xdbg$\x94\xcb{\xa9\xd6r,\xa1\u03f5\xfa\x91\x84B\xba9\x9e\xcf_93\x96\xe3\xc7XF\x9djx\x12\r\xf2(\v\xb2%a0\xdeD\xe5\xfax\xc0\xea~<\u052a\xdc\xfa\x8e]\xc0\x169\xc0\xf0\u048c\x80\x92\xa9\xca\rC\nuG~k\x95\x12\x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x05W\xdd-d:h\xe1T\u007f+w\r\x92\x85Vk\xec\xfb\x01\xc3\xf2P\xe4\x86\xee\xa8[\x93\xa8\xf59X\x9d\xb3a\xa7\x11\x17bL?\xe0+\xd6<\x1csU\xdd\"n\xf6\x1c\xf3\xb7P\x1a_\xd2\u007f\xf2\xd0&\xe7\xf0\xed\xa3>\xcb\xc9\u015b\x17\x94Cw\x18\xbd~=\xf4F\xdd\xff\x05\xf1\xdf(\x88\xfdz\u8346\xfa\n\xa9+\xe1g\xba\xf9\xeai\xd0\\I_\xcb};;\x9fF\xec\x82\xea\x17\xf3\x8a{\xb7\x87\xec\xfd\xf8\u00f0\r\x15\xf8\x82vq\xe1\xab\xe7\xa9\xc5\xf6\xaf\x17\xc0\xc9\u0784\x9ex\v.\xc3S\xe2\xe8\xaa\x1f\xb6S\xa8_\xc0\xe6\x96\xda\xed\v}rq\x00\xd2k\xeb\x17\xa3t\xca\xe3\x18\xc6!@\xd9|\xb77h\xf7/\x10\x91R\x8e\x12\xac\xd1\u007f\x00\x00\x00\xff\xff\x01\x00\x00\xff\xff\xd3\xcc\x14I\x98\x10\x00\x00"),
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
// +build !embed
|
|
||||||
|
|
||||||
// Automagically generated by yaber v0.2 (https://github.com/lmas/yaber),
|
|
||||||
// please avoid editting this file as it might be regenerated again.
|
|
||||||
|
|
||||||
package assettemplates
|
|
||||||
|
|
||||||
import (
|
|
||||||
"io/ioutil"
|
|
||||||
"path/filepath"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Asset(path string) ([]byte, error) {
|
|
||||||
return ioutil.ReadFile(path)
|
|
||||||
}
|
|
||||||
|
|
||||||
func AssetDir(dir string) (map[string][]byte, error) {
|
|
||||||
list := make(map[string][]byte)
|
|
||||||
dirs := []string{dir}
|
|
||||||
|
|
||||||
for len(dirs) > 0 {
|
|
||||||
d := dirs[0]
|
|
||||||
dirs = dirs[1:]
|
|
||||||
files, e := ioutil.ReadDir(d)
|
|
||||||
if e != nil {
|
|
||||||
return nil, e
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, f := range files {
|
|
||||||
fpath := filepath.Join(d, f.Name())
|
|
||||||
|
|
||||||
if f.IsDir() {
|
|
||||||
dirs = append(dirs, fpath)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !f.Mode().IsRegular() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
fbody, e := ioutil.ReadFile(fpath)
|
|
||||||
if e != nil {
|
|
||||||
return nil, e
|
|
||||||
}
|
|
||||||
list[fpath] = fbody
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list, nil
|
|
||||||
}
|
|
||||||
10
src/web.go
10
src/web.go
@ -10,8 +10,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/lmas/ss13_se/src/assetstatic"
|
|
||||||
"github.com/lmas/ss13_se/src/assettemplates"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (i *Instance) Init() {
|
func (i *Instance) Init() {
|
||||||
@ -46,9 +44,13 @@ func (i *Instance) Serve(addr string) error {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WHen in debug mode we load the assets from disk instead of the
|
||||||
|
// embedded ones.
|
||||||
|
SetRawAssets(i.Debug)
|
||||||
|
|
||||||
// Load templates
|
// Load templates
|
||||||
tmpl := template.New("AllTemplates").Funcs(funcmap)
|
tmpl := template.New("AllTemplates").Funcs(funcmap)
|
||||||
tmplfiles, err := assettemplates.AssetDir("templates/")
|
tmplfiles, err := AssetDir("templates/")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -59,7 +61,7 @@ func (i *Instance) Serve(addr string) error {
|
|||||||
i.router.SetHTMLTemplate(tmpl)
|
i.router.SetHTMLTemplate(tmpl)
|
||||||
|
|
||||||
// Load static files
|
// Load static files
|
||||||
staticfiles, e := assetstatic.AssetDir("static/")
|
staticfiles, e := AssetDir("static/")
|
||||||
if e != nil {
|
if e != nil {
|
||||||
panic(e)
|
panic(e)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user