it is TECHNICALLY mvp
parent
dceebd5755
commit
a4eedc7a86
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
@ -31,7 +32,9 @@ func (h Handler) serveHTTP(w http.ResponseWriter, r *http.Request) error {
|
||||||
return h.ui(w, r)
|
return h.ui(w, r)
|
||||||
} else if strings.HasPrefix(r.URL.Path, "/experimental/echo") {
|
} else if strings.HasPrefix(r.URL.Path, "/experimental/echo") {
|
||||||
b, _ := io.ReadAll(r.Body)
|
b, _ := io.ReadAll(r.Body)
|
||||||
fmt.Fprintf(w, "%s / %s\n", r.URL.String(), b)
|
s := fmt.Sprintf("%s / %s", r.URL.String(), b)
|
||||||
|
fmt.Fprintf(w, "%s\n", s)
|
||||||
|
log.Printf("%s", b)
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,33 @@
|
||||||
<html>
|
<html>
|
||||||
|
<header>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.css">
|
||||||
|
</header>
|
||||||
<body>
|
<body>
|
||||||
<h2>Hello templated world</h2>
|
<h2>Feeds</h2>
|
||||||
{{ range feeds }}
|
|
||||||
feed = {{ . }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<form method="POST" action="/v1/feeds">
|
<div>
|
||||||
{{ range feedsVersionFields }}
|
{{ range feeds }}
|
||||||
<div>
|
<div>
|
||||||
<label for="{{ . }}">{{ . }}</label>
|
<h4>{{ .Version.URL }}</h4>
|
||||||
<input name="{{ . }}" type="text" />
|
<h5>{{ .Version.Created }} (last {{ .Execution.Executed }})</h5>
|
||||||
</div>
|
<div>@{{ .Version.Cron }} ~"{{ .Version.Pattern }}"</div>
|
||||||
|
<div>{{ .Version.WebhookMethod }} {{ .Version.WebhookURL }} | {{ .Version.WebhookBody }}</div>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<button type="submit">Submit</button>
|
</div>
|
||||||
</form>
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<form method="POST" action="/v1/feeds">
|
||||||
|
{{ range feedsVersionFields }}
|
||||||
|
<div>
|
||||||
|
<label for="{{ . }}">{{ . }}</label>
|
||||||
|
<input name="{{ . }}" type="text" />
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
<button type="submit">Submit</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue