diff --git a/request_builder.go b/request_builder.go index f8f5514..dc4ff63 100644 --- a/request_builder.go +++ b/request_builder.go @@ -19,7 +19,7 @@ func buildRequest(req *http.Request) (*Request, error) { Uri: strings.Split(uri, "/"), GetData: FetchGetData(req), FormData: FetchFormData(req), - UrlData: make(map[int]interface{}, 0), + UrlData: make([]interface{}, 0), Data: make(map[string]interface{}, 0), } inst.ControllerUri = make([]string, 0, len(inst.Uri)) diff --git a/router.go b/router.go index 202a879..af5624a 100644 --- a/router.go +++ b/router.go @@ -18,10 +18,6 @@ func (s Server) route(res http.ResponseWriter, req *http.Request) { log.Fatal(req) } - // fmt.Printf("Uri: %v\n", request.Uri) - // fmt.Printf("GET: %v\n", request.GetData) - // fmt.Printf("POST: %v\n", request.FormData) - /* (2) Find a controller ---------------------------------------------------------*/ /* (1) Init browsing cursors */ @@ -50,7 +46,7 @@ func (s Server) route(res http.ResponseWriter, req *http.Request) { /* (4) Store them as Data */ for i, data := range uriParams { - request.UrlData[i] = data + request.UrlData = append(request.UrlData, data) request.Data[fmt.Sprintf("URL#%d", i)] = data } diff --git a/types.go b/types.go index 3758465..21002f1 100644 --- a/types.go +++ b/types.go @@ -15,6 +15,6 @@ type Request struct { ControllerUri []string FormData map[string]interface{} GetData map[string]interface{} - UrlData map[int]interface{} + UrlData []interface{} Data map[string]interface{} }