mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-04-22 14:59:16 +00:00
feat: add healtcheck app
Signed-off-by: rare-magma <rare-magma@posteo.eu>
This commit is contained in:
parent
e409176642
commit
8d31aaa734
1 changed files with 20 additions and 0 deletions
20
src/healthcheck/healthcheck.go
Normal file
20
src/healthcheck/healthcheck.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
log.Fatal("Expected URL as command-line argument")
|
||||
os.Exit(1)
|
||||
}
|
||||
url := os.Args[1]
|
||||
fmt.Println(url)
|
||||
if _, err := http.Get(url); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue