aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/api/datamaps.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/api/datamaps.go')
-rw-r--r--cmd/api/datamaps.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmd/api/datamaps.go b/cmd/api/datamaps.go
new file mode 100644
index 0000000..53f08bf
--- /dev/null
+++ b/cmd/api/datamaps.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "fmt"
+ "net/http"
+ "strconv"
+)
+
+func (app *application) createDatamapHandler(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintln(w, "create new datamaps page")
+}
+
+func (app *application) showDatamapHandler(w http.ResponseWriter, r *http.Request) {
+ id := r.PathValue("id")
+ app.logger.Info("the id requested", "id", id)
+ id_int, err := strconv.ParseInt(id, 10, 64)
+ // TODO: Handle negative integers passed in the URL here
+ if err != nil {
+ http.NotFound(w, r)
+ return
+ }
+ fmt.Fprintf(w, "show the details for datamap %d\n", id_int)
+}