diff options
| author | Jeff Carr <[email protected]> | 2024-01-17 16:05:28 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-17 16:05:28 -0600 |
| commit | 44ab3d16796df32ea72bf2cb5fdfeed666a1e2e1 (patch) | |
| tree | 9715e48b1e1ac79994ab185cb709bcb11b92eb10 /main.go | |
| parent | 6909acbbe46a09b92b89718604ab5ee674bb7272 (diff) | |
dump /me as JSON and /list for the autotypistv0.0.1
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -48,8 +48,21 @@ func okHandler(w http.ResponseWriter, r *http.Request) { findFile(w, "files/index.html") return } + if tmp == "/me" { + j, err := dumpJsonClient(r) + if err != nil { + fmt.Fprintln(w, "BAD ZOOT") + return + } + fmt.Fprintln(w, j) + return + } + if tmp == "/list" { + findFile(w, "files/repomap") + return + } if tmp == "/test" { - findFile(w, "files/repo.html") + findFile(w, "files/test.html") return } if tmp == "/skeleton.v2.css" { @@ -86,14 +99,6 @@ func findFile(w http.ResponseWriter, filename string) { func main() { accessf, _ = os.OpenFile("/home/jcarr/accessclient.log", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666) clientf, _ = os.OpenFile("/home/jcarr/httpclient.log", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666) - /* - pfile, err := htmlFiles.ReadFile("html/repo.html") - if (err != nil) { - log.Println("ERROR:", err) - // w.Write(pfile) - return - } - */ readconfigfile() http.HandleFunc("/", okHandler) https() |
