arnaucube
arnaucube/padArchiverPublic Self-hosted repository
padArchiver/apiServer/readConfig.go
apiServer/readConfig.goRaw
 1package main
 2
 3import (
 4	"encoding/json"
 5	"io/ioutil"
 6)
 7
 8//Config is the configuration of the API server
 9type Config struct {
10	Port string `json:"port"`
11}
12
13var config Config
14
15func readConfig(path string) {
16	file, err := ioutil.ReadFile(path)
17	check(err)
18	content := string(file)
19	json.Unmarshal([]byte(content), &config)
20}