Add a basic main page with login

None of the links work and the marketing copy sucks, but it's just
showing the bones while I figure the technical bits out.
This commit is contained in:
Eli Ribble 2025-11-03 22:13:11 +00:00
parent 25039a8f54
commit 56eaa4ed1c
No known key found for this signature in database
10 changed files with 266 additions and 3 deletions

31
response.go Normal file
View file

@ -0,0 +1,31 @@
package main
import (
"net/http"
)
// Custom ResponseWriter to track Content-Type
type customResponseWriter struct {
http.ResponseWriter
contentType string
wroteHeader bool
}
func (crw *customResponseWriter) WriteHeader(code int) {
crw.wroteHeader = true
crw.ResponseWriter.WriteHeader(code)
}
func (crw *customResponseWriter) Header() http.Header {
return crw.ResponseWriter.Header()
}
func (crw *customResponseWriter) Write(b []byte) (int, error) {
if !crw.wroteHeader {
if crw.contentType == "" {
crw.contentType = http.DetectContentType(b)
crw.ResponseWriter.Header().Set("Content-Type", crw.contentType)
}
crw.WriteHeader(http.StatusOK)
}
return crw.ResponseWriter.Write(b)
}