Commit cc502407 authored by vicotor's avatar vicotor

update

parent 44421f0d
......@@ -30,7 +30,7 @@ func (c *CaddyAPI) buildPayloadForCreateWebsite(domain string, root string) (str
RootDir: root,
WebsiteCaddyFile: filepath.Join(c.RootDir, fmt.Sprintf("%s.caddy", domain)),
}
tmpl, err := template.New("test").Parse(staticWebsiteCaddyFileTempl)
tmpl, err := template.New("test").Parse(newWebsitePayloadTempl)
if err != nil {
log.WithError(err).Error("failed to parse website caddyfile template")
return "", err
......@@ -88,6 +88,7 @@ func (c *CaddyAPI) CreateWebsite(domain string, resource string) error {
// send put request to the caddy api.
path := fmt.Sprintf("%s/config/apps/http/servers/srv0/routes/%d", c.Url, 0)
log.WithField("payload", payload).Debug("sending payload to caddy")
if err := c.put(path, []byte(payload)); err != nil {
return err
}
......
......@@ -33,6 +33,7 @@ func setlog(path string) func() {
if err != nil {
log.Fatal(err)
}
log.SetLevel(log.DebugLevel)
log.SetOutput(file)
return func() {
file.Close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment