goRecommender/serverRoutes.go
serverRoutes.goRaw
1package main
2
3import (
4 "fmt"
5 "net/http"
6)
7
8type Routes []Route
9
10var routes = Routes{
11 Route{
12 "Index",
13 "GET",
14 "/",
15 Index,
16 },
17 Route{
18 "NewImage",
19 "POST",
20 "/image",
21 NewImage,
22 },
23}
24
25//ROUTES
26
27func Index(w http.ResponseWriter, r *http.Request) {
28 fmt.Fprintln(w, "send images to the /image path")
29}
30func NewImage(w http.ResponseWriter, r *http.Request) {
31 fmt.Fprintln(w, "response")
32}