628bc92e66
Signed-off-by: Odyssey346 <odyssey346@disroot.org>
29 lines
688 B
Go
29 lines
688 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"html/template"
|
|
"io"
|
|
"log"
|
|
"github.com/ProjectSegfault/segfautilities/otherthings"
|
|
)
|
|
|
|
type StaticThingy struct {
|
|
Port string
|
|
}
|
|
|
|
func main() {
|
|
log.Println("[Segfautilities] Starting")
|
|
otherthings.CheckEnv()
|
|
tmpl := template.Must(template.ParseFiles("static/index.html"))
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
data := StaticThingy{
|
|
Port: "3000",
|
|
}
|
|
tmpl.Execute(w, data)
|
|
})
|
|
http.HandleFunc("/api/", func(w http.ResponseWriter, r *http.Request) {
|
|
io.WriteString(w, "welcome to hell")
|
|
})
|
|
http.ListenAndServe(":3000", nil)
|
|
} |