forked from kontinu/container-expert-scratch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
44 lines (38 loc) · 913 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"fmt"
"log"
"net/http"
"os"
extras "./extras"
)
func root(w http.ResponseWriter, r *http.Request) {
var kontinu_msg = os.Getenv("MSG")
if len(kontinu_msg) <= 0 {
kontinu_msg = "< go: Bootcamp Experts 🤓! >"
}
fmt.Println(r.URL.RawQuery)
//msg,host := extras.KontinuEndpoint()
//w.Header().Add("HostChain", host)
fmt.Fprintf(w, `
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
{ / ===-
\______ O __/
\ \ __/
\____\_______/
%s
- Go
`, kontinu_msg)
}
func main() {
fmt.Println("====== Starting GO Server ======")
//http.HandleFunc("/env", extras.GetValue)
//http.HandleFunc("/config", extras.ConfigRead)
http.HandleFunc("/health", extras.Health)
http.HandleFunc("/api", extras.KontinuResponse)
http.HandleFunc("/", root)
log.Fatal(http.ListenAndServe(":8080", nil))
}