<commit_before>package main

import (
	"github.com/codegangsta/cli"
	"github.com/codegangsta/negroni"
	"github.com/gorilla/mux"
	_ "github.com/jinzhu/gorm"
	"github.com/unrolled/render"
	"net/http"
)

var Render = render.New()

func HomeHandler(w http.ResponseWriter, req *http.Request) {
	Render.JSON(w, http.StatusOK, map[string]string{"hello": "world"})
}

func RunServer(c *cli.Context) {
	router := mux.NewRouter()
	router.HandleFunc("/", HomeHandler)

	server := negroni.Classic()
	server.UseHandler(router)
	server.Run(":3000")
}
<commit_msg>Add single photo endpoint<commit_after>package main

import (
	// "fmt"
	"github.com/codegangsta/cli"
	"github.com/codegangsta/negroni"
	"github.com/gorilla/mux"
	"github.com/jinzhu/gorm"
	"github.com/unrolled/render"
	"net/http"
)

var Render = render.New()
var DB gorm.DB

func PhotosHandler(response http.ResponseWriter, request *http.Request) {
	Render.JSON(response, http.StatusOK, map[string]string{"hello": "world"})
}

func PhotoHandler(response http.ResponseWriter, request *http.Request) {
	vars := mux.Vars(request)
	id := vars["id"]

	var photo Photo
	DB.Preload("SimilarPhotos").First(&photo, id)
	Render.JSON(response, http.StatusOK, photo)
}

func SimilarPhotosHandler(response http.ResponseWriter, request *http.Request) {
	Render.JSON(response, http.StatusOK, map[string]string{"hello": "world"})
}

func RunServer(c *cli.Context) {
	router := mux.NewRouter()
	DB = SetupDatabase(c)

	router.HandleFunc("/photos", PhotosHandler)
	router.HandleFunc("/photos/{id}", PhotoHandler)
	router.HandleFunc("/similar", SimilarPhotosHandler)

	server := negroni.Classic()
	server.UseHandler(router)
	server.Run(":3000")
}

{'fraction_non_alphanumeric': 0.1592128801431127, 'fraction_numerical': 0.004770423375074538, 'mean_word_length': 5.606299212598425, 'pattern_counts': {'":': 5, '<': 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': '1952559', 'n_tokens_mistral': 617, 'n_tokens_neox': 597, 'n_words': 103}