Allow specifying path to conf as command line argument
This commit is contained in:
parent
fd8e140897
commit
0ed802ba6a
1 changed files with 7 additions and 3 deletions
|
|
@ -1,18 +1,22 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
|
|
||||||
"forgejo.gwairfelin.com/max/gonotes/internal/conf"
|
"forgejo.gwairfelin.com/max/gonotes/internal/conf"
|
||||||
"forgejo.gwairfelin.com/max/gonotes/internal/notes/views"
|
"forgejo.gwairfelin.com/max/gonotes/internal/notes/views"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
os.Mkdir("./foobardir", os.ModeDir|os.ModePerm)
|
var confFile string
|
||||||
conf.LoadConfig("./conf.toml")
|
|
||||||
|
flag.StringVar(&confFile, "c", "/etc/gonotes/conf.toml", "Specify path to config file. Default is /etc/gonotes/conf.toml")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
conf.LoadConfig(confFile)
|
||||||
|
|
||||||
router := http.NewServeMux()
|
router := http.NewServeMux()
|
||||||
notesRouter := views.GetRoutes("/notes")
|
notesRouter := views.GetRoutes("/notes")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue