added stuff, broke some other stuff, made admin auth!

Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
ari melody 2024-07-31 04:09:22 +01:00
parent 0d1e694b59
commit 5631c4bd87
26 changed files with 1615 additions and 1401 deletions

View file

@ -1,20 +1,12 @@
package api
import (
"net/http"
"html/template"
"arimelody.me/arimelody.me/api/v1/admin"
"net/http"
"html/template"
)
func Handle(writer http.ResponseWriter, req *http.Request, root *template.Template) int {
code := 404;
if req.URL.Path == "/api/v1/admin/login" {
code = admin.HandleLogin(writer, req, root)
}
if code == 404 {
writer.Write([]byte("404 not found"))
}
return code;
writer.WriteHeader(501)
writer.Write([]byte("501 Not Implemented"))
return 501;
}