2024-10-11 10:20:07 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
2024-10-14 11:01:06 +00:00
|
|
|
|
2024-10-14 16:23:55 +00:00
|
|
|
"github.com/go-vela/sdk-go/vela" // import to get a trivy error
|
2024-10-14 11:01:06 +00:00
|
|
|
log "github.com/sirupsen/logrus"
|
2024-10-11 10:20:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
http.HandleFunc("/", helloWorldHandler)
|
|
|
|
port := 9000
|
2024-10-14 16:23:55 +00:00
|
|
|
xx := vela.Client{}
|
|
|
|
|
|
|
|
password := "1247fsfd98jdgfklsj"
|
2024-10-11 10:20:07 +00:00
|
|
|
|
|
|
|
log.Info("Starting on port ", port)
|
2024-10-14 16:23:55 +00:00
|
|
|
log.Debug("password", password, xx)
|
2024-10-11 10:20:07 +00:00
|
|
|
|
2024-10-14 11:01:06 +00:00
|
|
|
err := http.ListenAndServe(fmt.Sprint(":", port), nil)
|
|
|
|
if err != nil {
|
|
|
|
log.Error("Something bad happened")
|
|
|
|
}
|
2024-10-11 10:20:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func helloWorldHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
|
log.Info("Request from", r.RemoteAddr)
|
2024-10-14 11:01:06 +00:00
|
|
|
_, err := w.Write([]byte("Hello World"))
|
|
|
|
if err != nil {
|
|
|
|
log.Error("Unable to write hello world")
|
|
|
|
}
|
2024-10-11 10:20:07 +00:00
|
|
|
}
|