Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

34 lignes
763B

  1. package main
  2. import (
  3. "log"
  4. "net/http"
  5. )
  6. func main() {
  7. err := readConfig() //wechat API config
  8. if err != nil {
  9. log.Println(err)
  10. log.Fatal("unable to read server_config.json, program quit")
  11. return
  12. }
  13. err = readCRMConfig()
  14. if err != nil {
  15. log.Println(err)
  16. log.Fatal("unable to read crm_config.json, program quit")
  17. }
  18. //fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/ng2-admin/dist"))
  19. fs := http.FileServer(http.Dir("/mnt/data/workspace/angular.ts/wechat/ng2-admin/dist"))
  20. http.Handle("/test/", http.StripPrefix("/test", fs))
  21. //setup handler
  22. http.HandleFunc("/", webrootHandler)
  23. http.HandleFunc("/api", apiV1Main)
  24. //http.ListenAndServe("127.0.0.1:65500", nil)
  25. //CreateDefaultMenu()
  26. http.ListenAndServe(":65500", nil)
  27. }