snapshot before merge
This commit is contained in:
1 parent
06a5f3da4d
commit
671871e0b2
145 files changed
+9786
-59
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
var lg *log.Logger
|
||||
|
||||
func main() {
|
||||
lg = log.New(os.Stdout, "[TEST] ", log.LstdFlags)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/api/posts/", func(w http.ResponseWriter, r *http.Request) {
|
||||
lg.Printf("GOT posts/ handler: path=%s method=%s", r.URL.Path, r.Method)
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"handler":"posts/","path":"` + r.URL.Path + `"}`))
|
||||
})
|
||||
mux.HandleFunc("/api/posts", func(w http.ResponseWriter, r *http.Request) {
|
||||
lg.Printf("GOT posts handler: path=%s method=%s", r.URL.Path, r.Method)
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"handler":"posts","path":"` + r.URL.Path + `"}`))
|
||||
})
|
||||
|
||||
lg.Println("listening on :8701")
|
||||
log.Fatal(http.ListenAndServe(":8701", mux))
|
||||
}
|
||||
Reference in new issue
Block a user