add dummy routes and handlers and update makefile
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package meteo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Handler struct{}
|
||||
|
||||
func NewHandler() *Handler {
|
||||
return &Handler{}
|
||||
}
|
||||
|
||||
func (h *Handler) IngestCSV(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "hello from csv")
|
||||
}
|
||||
|
||||
func (h *Handler) IngestExcel(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "hello from excel")
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package meteo
|
||||
|
||||
import "net/http"
|
||||
|
||||
func RegisterRoutes(mux *http.ServeMux, handler *Handler) {
|
||||
mux.HandleFunc("POST /ingest/csv", handler.IngestCSV)
|
||||
mux.HandleFunc("POST /ingest/excel", handler.IngestExcel)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func SetupRoutes() *http.ServeMux {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
mux.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "hello world")
|
||||
})
|
||||
|
||||
return mux
|
||||
}
|
||||
Reference in New Issue
Block a user