diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-13 08:52:18 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-13 08:52:18 +0800 |
commit | 3397c837b9690ddf506b3162e55c33ab7cf902cf (patch) | |
tree | f99b0cf0d75bff05db00f1a8b7c37e149adb6fd1 /http_server.go | |
parent | login: Set cookie (diff) | |
download | forge-3397c837b9690ddf506b3162e55c33ab7cf902cf.tar.gz forge-3397c837b9690ddf506b3162e55c33ab7cf902cf.tar.zst forge-3397c837b9690ddf506b3162e55c33ab7cf902cf.zip |
handle_user: Stub
Diffstat (limited to 'http_server.go')
-rw-r--r-- | http_server.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/http_server.go b/http_server.go index ddbe8ce..e769ace 100644 --- a/http_server.go +++ b/http_server.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "strings" + "strconv" ) type http_router_t struct{} @@ -48,7 +49,7 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) { if _user_id == 0 { params["user_id"] = "" } else { - params["user_id"] = string(_user_id) + params["user_id"] = strconv.Itoa(_user_id) } if segments[0] == ":" { @@ -56,14 +57,15 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) { case "login": handle_login(w, r, params) return + case "users": + handle_users(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 for i, part := range segments { if part == ":" { |