linstrom/server/notes.go

24 lines
564 B
Go
Raw Normal View History

2024-05-31 09:54:39 +00:00
package server
import (
"net/http"
"gitlab.com/mstarongitlab/linstrom/ap"
)
// Mount at /notes/{note-id}
// Handles the note endpoint
// Serves the json-ld representation of a note OR the frontend view
func noteHandler(w http.ResponseWriter, r *http.Request) {
if ap.ContainsApContentHeader(r.Header.Get("Content-Type")) {
apNote(w, r)
} else {
renderNote(w, r)
}
}
func renderNote(w http.ResponseWriter, r *http.Request) {
http.Error(w, "not implemented yet", http.StatusInternalServerError)
}
func apNote(w http.ResponseWriter, r *http.Request) {}