<commit_before>package app

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"

	"github.com/asaintgenis/catapi/data/cat"
	"github.com/gorilla/mux"
)

//Index useless println
func Index(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "Welcome!")
}

//CatsIndex send a json back with all the cats database
func CatsIndex(w http.ResponseWriter, r *http.Request) {
	cats := cat.Cats{
		cat.Cat{ID: "1"},
		cat.Cat{ID: "2"},
		cat.Cat{ID: "3"},
	}
	log.Println("Encoding to json....")
	json.NewEncoder(w).Encode(cats)
}

//CatShow show a specific required beautiful cat
func CatShow(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	todoID := vars["catId"]
	fmt.Fprintln(w, "cat show:", todoID)
}
<commit_msg>add header to http response<commit_after>package app

import (
	"encoding/json"
	"fmt"
	"net/http"

	"github.com/asaintgenis/catapi/data/cat"
)

//Index useless println
func Index(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(http.StatusOK)
	fmt.Fprintln(w, "Welcome!")
}

//CatsIndex send a json back with all the cats database
func CatsIndex(w http.ResponseWriter, r *http.Request) {
	cats := cat.Cats{
		cat.Cat{ID: "1"},
		cat.Cat{ID: "2"},
		cat.Cat{ID: "3"},
	}
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)
	if err := json.NewEncoder(w).Encode(cats); err != nil {
		panic(err)
	}
}

//CatShow show a specific required beautiful cat
func CatShow(w http.ResponseWriter, r *http.Request) {
	//vars := mux.Vars(r)
	//todoID := vars["catId"]
	w.WriteHeader(http.StatusNotImplemented)
	fmt.Fprintln(w, "Not yet Implemented !")
}

{'fraction_non_alphanumeric': 0.16759088108441159, 'fraction_numerical': 0.004313000616142945, 'mean_word_length': 4.324590163934427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5674873', 'n_tokens_mistral': 643, 'n_tokens_neox': 628, 'n_words': 142}