Procházet zdrojové kódy

added a request dumper for debugging angular2 app

master
Patrick Peng Sun před 8 roky
rodič
revize
eb5108d16a
1 změnil soubory, kde provedl 8 přidání a 0 odebrání
  1. +8
    -0
      main.go

+ 8
- 0
main.go Zobrazit soubor

package main package main


import ( import (
"fmt"
"log" "log"
"net/http" "net/http"
"net/http/httputil"
) )


//PathsConfig all system available pathes //PathsConfig all system available pathes
http.HandleFunc("/api", apiV1Main) http.HandleFunc("/api", apiV1Main)
http.HandleFunc("/upload", uploadHandler) http.HandleFunc("/upload", uploadHandler)
http.HandleFunc("/crmfiles/", crmAttachmentHandler) http.HandleFunc("/crmfiles/", crmAttachmentHandler)
http.HandleFunc("/dumprequest", dumpReuestHandler)
http.ListenAndServe(":65500", nil) http.ListenAndServe(":65500", nil)
} }


//fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/wechat/ng2-admin/dist")) //fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/wechat/ng2-admin/dist"))
//http.Handle("/", fs) //http.Handle("/", fs)
} }

func dumpReuestHandler(w http.ResponseWriter, r *http.Request) {
logRequestDebug(httputil.DumpRequest(r, true))
fmt.Fprintf(w, "")
}

Načítá se…
Zrušit
Uložit