summary refs log tree commit diff stats
path: root/handlers.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-11 03:04:28 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-11 03:04:28 -0400
commitb9d16fbfcc9032518cd464060276755a8d09caf4 (patch)
treedf10df98ca987e3fbbb571c92e72aa65d5d9f774 /handlers.go
parentfb63b07e950004068bc883818f84c9ddbbb9be02 (diff)
downloadgetwtxt-b9d16fbfcc9032518cd464060276755a8d09caf4.tar.gz
stubbed out handlers
Diffstat (limited to 'handlers.go')
-rw-r--r--handlers.go30
1 files changed, 17 insertions, 13 deletions
diff --git a/handlers.go b/handlers.go
index d57feee..4b2ceef 100644
--- a/handlers.go
+++ b/handlers.go
@@ -8,19 +8,7 @@ import (
 	"time"
 )
 
-func validRequest(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc {
-	return func(w http.ResponseWriter, r *http.Request) {
-		m := confObj.validPath.FindStringSubmatch(r.URL.Path)
-		if m == nil {
-			log.Printf("Invalid API request: %v", r.URL.Path)
-			http.Error(w, fmt.Errorf(r.URL.Path).Error(), http.StatusNotFound)
-			return
-		}
-		fn(w, r, m[2])
-	}
-}
-
-func apiHandler(w http.ResponseWriter, r *http.Request) {
+func apiBaseHandler(w http.ResponseWriter, r *http.Request) {
 	timerfc3339, err := time.Now().MarshalText()
 	if err != nil {
 		log.Printf("Couldn't format time as RFC3339: %v\n", err)
@@ -35,3 +23,19 @@ func apiHandler(w http.ResponseWriter, r *http.Request) {
 		log.Printf("Error writing to HTTP stream: %v\n", err)
 	}
 }
+
+func indexHandler(w http.ResponseWriter, r *http.Request) {
+
+}
+func apiFormatHandler(w http.ResponseWriter, r *http.Request) {
+
+}
+func apiEndpointHandler(w http.ResponseWriter, r *http.Request) {
+
+}
+func apiTagsBaseHandler(w http.ResponseWriter, r *http.Request) {
+
+}
+func apiTagsHandler(w http.ResponseWriter, r *http.Request) {
+
+}