INNER CODE UNIT · Go

PostTag

cryptag/cryptag · servers/inmemory-webserver/main.go:94

func PostTag(w http.ResponseWriter, req *http.Request) {
	pair := &types.TagPair{}
	if err := help.ReadInto(req.Body, pair); err != nil {
		help.WriteError(w, "Error reading tag pair: "+err.Error(),
			http.StatusInternalServerError)
		return
	}

	allTagPairs = append(allTagPairs, pair)
	if types.Debug {
		log.Printf("New TagPair added: `%#v`\n", pair)
	}

	help.WriteJSON(w, pair)
}

//
// Replace with Postgres or S3

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…