diff options
| author | wikiapiserver | 2026-06-25 15:42:32 +0200 |
|---|---|---|
| committer | wikiapiserver | 2026-06-25 15:42:32 +0200 |
| commit | 81258d39db6530699194f860206528c6f09a5238 (patch) | |
| tree | 015290ae2f28e1f8123c0efecfea078f80d2ff70 /main.go | |
| parent | 1a25a89dfeeb7ed5af4df77907b65f99bdf5399a (diff) | |
| download | wikiapiserver-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.go | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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{ |
