Parcourir la source

added a request dumper for debugging angular2 app

master
Patrick Peng Sun il y a 8 ans
Parent
révision
eb5108d16a
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. +8
    -0
      main.go

+ 8
- 0
main.go Voir le fichier

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, "")
}

Chargement…
Annuler
Enregistrer