index — crispy-website @ b8c8ce39f555547be4b60d011b2e7ed2016e8a06

My personal homepage (very crispy)

index.go (view raw)

 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
package main

import (
	"log"
	"net/http"
)


func viewHandler(w http.ResponseWriter, r *http.Request) {
	http.ServeFile(w, r, "templates/index.html")
}

func plainTextHandler(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "text/plain")
	w.Write([]byte("dh=b81129b4e9cc388c5ab63919550316fc3ca5ebe4"))
}

func main() {
	fs := http.FileServer(http.Dir("static"))
	http.Handle("/static/", http.StripPrefix("/static/", fs))

	http.HandleFunc("/", viewHandler)
	http.HandleFunc("/music", musicHandler)

	http.HandleFunc("/.well-known/discord", plainTextHandler)

	log.Fatal(http.ListenAndServe("0.0.0.0:8080", nil))
}