Download task_047/solution/code/cmd/server/main.go from Lego-X/UXInteract: direct link, hf CLI and curl.
- Browser
- Download file 376 Bytes
-
https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_047/solution/code/cmd/server/main.go
- Command line
-
hf download hf://datasets/Lego-X/UXInteract/task_047/solution/code/cmd/server/main.go
-
curl -L -o main.go https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_047/solution/code/cmd/server/main.go
376 Bytes
| package main | |
| import ( | |
| "log" | |
| loganalyzer "log_analyzer" | |
| "net/http" | |
| "os" | |
| ) | |
| func main() { | |
| port := os.Getenv("PORT") | |
| if port == "" { | |
| port = "8081" | |
| } | |
| file := os.Getenv("LOG_FILE") | |
| if file == "" { | |
| file = "logs.jsonl" | |
| } | |
| repo := loganalyzer.NewRepositoryFromConfig(os.Getenv("STORAGE"), file) | |
| log.Fatal(http.ListenAndServe(":"+port, loganalyzer.NewHandler(repo))) | |
| } | |