Download api/index.go from a3216/ds2api: direct link, hf CLI and curl.
- Browser
- Download file 229 Bytes
-
https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/api/index.go
- Command line
-
hf download hf://spaces/a3216/ds2api@ce5a019598af8a3a8fa70d3880098df3e850ecd7/api/index.go
-
curl -L -o index.go https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/api/index.go
229 Bytes
| package handler | |
| import ( | |
| "net/http" | |
| "sync" | |
| "ds2api/app" | |
| ) | |
| var ( | |
| once sync.Once | |
| h http.Handler | |
| ) | |
| func Handler(w http.ResponseWriter, r *http.Request) { | |
| once.Do(func() { | |
| h = app.NewHandler() | |
| }) | |
| h.ServeHTTP(w, r) | |
| } | |