config: server host and port
Mon, 12 Dec 2022
3 files changed,
11 insertions(+),
1 deletions(-)
M
config.yaml
@@ -10,3 +10,6 @@ dir: ./templates
meta: title: git good description: i think it's a skill issue +server: + host: 127.0.0.1 + port: 5555
M
config/config.go
@@ -19,6 +19,10 @@ Meta struct {
Title string `yaml:"title"` Description string `yaml:"description"` } `yaml:"meta"` + Server struct { + Host string `yaml:"host"` + Port int `yaml:"port"` + } `yaml:"server"` } func Read(f string) (*Config, error) {
M
main.go
@@ -2,6 +2,7 @@ package main
import ( "flag" + "fmt" "log" "net/http"@@ -20,5 +21,7 @@ log.Fatal(err)
} mux := routes.Handlers(c)
… preview truncated