24 lines
564 B
Go
24 lines
564 B
Go
|
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) {}
|