handler 경로 변경
This commit is contained in:
@ -44,15 +44,18 @@ func NewHoustonHandler() HoustonServerWithHandler {
|
|||||||
|
|
||||||
func (h *houstonHandler) RegisterHandlers(serveMux *http.ServeMux, prefix string) error {
|
func (h *houstonHandler) RegisterHandlers(serveMux *http.ServeMux, prefix string) error {
|
||||||
logger.Println("houstonHandler registed")
|
logger.Println("houstonHandler registed")
|
||||||
serveMux.Handle("/"+path.Join(prefix, "houston"), h)
|
if len(prefix) > 0 {
|
||||||
|
prefix = "/" + prefix
|
||||||
|
}
|
||||||
|
serveMux.Handle(prefix, h)
|
||||||
|
|
||||||
fsx := http.FileServer(http.Dir("deploys"))
|
fsx := http.FileServer(http.Dir("deploys"))
|
||||||
serveMux.Handle(fmt.Sprintf("/%s/deploys/", prefix), http.StripPrefix(fmt.Sprintf("/%s/deploys/", prefix), fsx))
|
serveMux.Handle(fmt.Sprintf("%s/deploys/", prefix), http.StripPrefix(fmt.Sprintf("%s/deploys/", prefix), fsx))
|
||||||
|
|
||||||
ufsx := http.FileServer(http.Dir("downloads"))
|
ufsx := http.FileServer(http.Dir("downloads"))
|
||||||
serveMux.Handle(fmt.Sprintf("/%s/houston/downloads/", prefix), http.StripPrefix(fmt.Sprintf("/%s/houston/downloads/", prefix), ufsx))
|
serveMux.Handle(fmt.Sprintf("%s/downloads/", prefix), http.StripPrefix(fmt.Sprintf("%s/downloads/", prefix), ufsx))
|
||||||
|
|
||||||
serveMux.HandleFunc("/"+path.Join(prefix, "upload"), func(w http.ResponseWriter, r *http.Request) {
|
serveMux.HandleFunc(fmt.Sprintf("%s/upload", prefix), func(w http.ResponseWriter, r *http.Request) {
|
||||||
defer func() {
|
defer func() {
|
||||||
s := recover()
|
s := recover()
|
||||||
if s != nil {
|
if s != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user