1
0

Fixed no root path for templates and static assets (#12)

This commit is contained in:
konrad
2018-11-02 10:01:28 +00:00
committed by Gitea
parent c51ca4dd26
commit 4f8a0f8739
5 changed files with 14 additions and 2 deletions

View File

@ -4,6 +4,8 @@ import (
"crypto/rand"
"fmt"
"github.com/spf13/viper"
"os"
"path/filepath"
"strings"
)
@ -21,6 +23,12 @@ func InitConfig() (err error) {
viper.SetDefault("service.JWTSecret", random)
viper.SetDefault("service.interface", ":3456")
viper.SetDefault("service.frontendurl", "")
ex, err := os.Executable()
if err != nil {
panic(err)
}
exPath := filepath.Dir(ex)
viper.SetDefault("service.rootpath", exPath)
// Database
viper.SetDefault("database.type", "sqlite")
viper.SetDefault("database.host", "localhost")