First green in control server

This commit is contained in:
Héctor Hurtado
2019-10-08 15:14:50 +02:00
parent 3fa2357f71
commit 198584f517
2 changed files with 37 additions and 11 deletions
+4 -5
View File
@@ -1,12 +1,12 @@
package control
import (
"io"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/BBVA/kapow/internal/server/model"
"github.com/BBVA/kapow/internal/server/user"
)
@@ -34,8 +34,7 @@ func listRoutes(http.ResponseWriter, *http.Request) {
}
func addRoute(http.ResponseWriter, *http.Request) {
var routeSpec model.Route
user.Routes.Append(routeSpec)
func addRoute(res http.ResponseWriter, req *http.Request) {
res.WriteHeader(http.StatusCreated)
_, _ = io.Copy(res, req.Body)
}