Download app/handler.go from a3216/ds2api: direct link, hf CLI and curl.
- Browser
- Download file 366 Bytes
-
https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/app/handler.go
- Command line
-
hf download hf://spaces/a3216/ds2api@ce5a019598af8a3a8fa70d3880098df3e850ecd7/app/handler.go
-
curl -L -o handler.go https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/app/handler.go
366 Bytes
| package app | |
| import ( | |
| "net/http" | |
| "ds2api/internal/config" | |
| "ds2api/internal/server" | |
| ) | |
| func NewHandler() http.Handler { | |
| app, err := server.NewApp() | |
| if err != nil { | |
| config.Logger.Error("[app] init failed", "error", err) | |
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
| server.WriteUnhandledError(w, err) | |
| }) | |
| } | |
| return app.Router | |
| } | |