aboutsummaryrefslogtreecommitdiff
path: root/http_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'http_server.go')
-rw-r--r--http_server.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/http_server.go b/http_server.go
index 4d2d77c..ddbe8ce 100644
--- a/http_server.go
+++ b/http_server.go
@@ -34,12 +34,11 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
switch segments[1] {
case "static":
static_handler.ServeHTTP(w, r)
+ return
case "source":
source_handler.ServeHTTP(w, r)
- default:
- http.Error(w, fmt.Sprintf("Unknown system module type: %s", segments[1]), http.StatusNotFound)
+ return
}
- return
}
params := make(map[string]any)
@@ -52,6 +51,17 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
params["user_id"] = string(_user_id)
}
+ if segments[0] == ":" {
+ switch segments[1] {
+ case "login":
+ handle_login(w, r, params)
+ return
+ default:
+ http.Error(w, fmt.Sprintf("Unknown system module type: %s", segments[1]), http.StatusNotFound)
+ return
+ }
+ }
+
fmt.Printf("%#v\n", params)
separator_index := -1