added stuff, broke some other stuff, made admin auth!
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
parent
0d1e694b59
commit
5631c4bd87
26 changed files with 1615 additions and 1401 deletions
18
api/api.go
18
api/api.go
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue