summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorwikiapiserver2026-06-25 15:42:32 +0200
committerwikiapiserver2026-06-25 15:42:32 +0200
commit81258d39db6530699194f860206528c6f09a5238 (patch)
tree015290ae2f28e1f8123c0efecfea078f80d2ff70 /main.go
parent1a25a89dfeeb7ed5af4df77907b65f99bdf5399a (diff)
downloadwikiapiserver-81258d39db6530699194f860206528c6f09a5238.tar.gz
feat: GET /article endpoint proxies Wikimedia structured contents
GET /article?username=alice&name=en.wikipedia/Sun → proxies to api.enterprise.wikimedia.com/v2/structured-contents/{name} with Authorization: Bearer <access_token> Returns 401 for unknown users, 400 if params missing, and passes through the upstream HTTP status on errors.
Diffstat (limited to 'main.go')
-rw-r--r--main.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.go b/main.go
index f2cf44d..341a175 100644
--- a/main.go
+++ b/main.go
@@ -87,6 +87,7 @@ func main() {
mux.HandleFunc("POST /refresh", handler.Refresh)
mux.HandleFunc("GET /health", handler.Health)
mux.HandleFunc("GET /token", handler.GetToken)
+ mux.HandleFunc("GET /article", handler.GetArticle)
addr := fmt.Sprintf(":%d", cfg.Server.Port)
srv := &http.Server{