This repository has been archived on 2022-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
Segfautils/main.go

25 lines
538 B
Go
Raw Normal View History

package main
import (
"net/http"
"html/template"
"io"
)
type StaticThingy struct {
Port string
}
func main() {
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)
}