Skip to content

Commit

Permalink
Read configuration from the 1st parameter not stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
hymkor committed May 17, 2020
1 parent b01c9cb commit b588495
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,20 @@ func (this *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {

func mains(args []string) error {
var handler Handler
err := handler.Config.Read(os.Stdin)
if err != nil {
return err
for _, configFname := range args {
fd, err := os.Open(configFname)
if err != nil {
return err
}
err = handler.Config.Read(fd)
fd.Close()
if err != nil {
return err
}
}
enableHtmlInMarkdown(handler.Config.Markdown.Html)
handler.notFound = http.NotFoundHandler()
var err error
handler.workDir, err = os.Getwd()
if err != nil {
return err
Expand Down

0 comments on commit b588495

Please sign in to comment.