remove concept of prod and dev assets

instead always do the "prod" thing, but use entr for restarting the
server for all assets
This commit is contained in:
sentriz
2019-07-08 13:36:26 +01:00
parent b44b0d8720
commit ba2f835c22
11 changed files with 59 additions and 106 deletions

27
server/assets_getters.go Normal file
View File

@@ -0,0 +1,27 @@
package server
import (
"bytes"
"errors"
"io"
"time"
)
var errAssetNotFound = errors.New("asset not found")
func findAsset(path string) (time.Time, io.ReadSeeker, error) {
asset, ok := assetBytes[path]
if !ok {
return time.Time{}, nil, errAssetNotFound
}
reader := bytes.NewReader(asset.Bytes)
return asset.ModTime, reader, nil
}
func findAssetBytes(path string) (time.Time, []byte, error) {
asset, ok := assetBytes[path]
if !ok {
return time.Time{}, nil, errAssetNotFound
}
return asset.ModTime, asset.Bytes, nil
}