<commit_before>// Copyright 2016 The front Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package main

import (
	"net/http"

	"github.com/codegangsta/negroni"
	"github.com/goincremental/negroni-sessions"
	"github.com/goincremental/negroni-sessions/cookiestore"
	"github.com/julienschmidt/httprouter"
	"github.com/repejota/logger"
	"github.com/tvtio/front/routes"
)

// Start starts the HTTP Server of the application
// * Define the routes
// * Setup middleware engine
//
func Start() error {
	l := logger.New("default")

	// Setup middleware
	middle := negroni.Classic()
	store := cookiestore.New([]byte("keyboard cat"))
	middle.Use(sessions.Sessions("tvtio", store))

	// Setup router
	router := httprouter.New()

	router.GET("/", routes.Index)

	router.GET("/search", routes.Search)

	router.GET("/movie/:id", routes.Movie)

	router.GET("/tv/:id", routes.TV)
	router.GET("/tv/:id/season/:snumber", routes.Season)
	router.GET("/tv/:id/season/:snumber/episode/:enumber", routes.Episode)

	router.GET("/person/:id", routes.Person)

	router.GET("/about", routes.About)
	router.GET("/policy", routes.Policy)
	router.GET("/terms", routes.Terms)
	router.GET("/support", routes.Support)

	router.ServeFiles("/css/*filepath", http.Dir("/go/src/github.com/tvtio/front/templates/css"))
	router.ServeFiles("/js/*filepath", http.Dir("/go/src/github.com/tvtio/front/templates/js"))
	router.ServeFiles("/img/*filepath", http.Dir("/go/src/github.com/tvtio/front/templates/img"))

	// Apply middleware to the router
	middle.UseHandler(router)

	l.Infof("Listening at :8080")

	// Start server
	return http.ListenAndServe(":8080", middle)
}
<commit_msg>env var for templates<commit_after>// Copyright 2016 The front Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package main

import (
	"fmt"
	"net/http"
	"os"

	"github.com/codegangsta/negroni"
	"github.com/goincremental/negroni-sessions"
	"github.com/goincremental/negroni-sessions/cookiestore"
	"github.com/julienschmidt/httprouter"
	"github.com/repejota/logger"
	"github.com/tvtio/front/routes"
)

// Start starts the HTTP Server of the application
// * Define the routes
// * Setup middleware engine
//
func Start() error {
	l := logger.New("default")

	// Setup middleware
	middle := negroni.Classic()
	store := cookiestore.New([]byte("keyboard cat"))
	middle.Use(sessions.Sessions("tvtio", store))

	// Setup router
	router := httprouter.New()

	router.GET("/", routes.Index)

	router.GET("/search", routes.Search)

	router.GET("/movie/:id", routes.Movie)

	router.GET("/tv/:id", routes.TV)
	router.GET("/tv/:id/season/:snumber", routes.Season)
	router.GET("/tv/:id/season/:snumber/episode/:enumber", routes.Episode)

	router.GET("/person/:id", routes.Person)

	router.GET("/about", routes.About)
	router.GET("/policy", routes.Policy)
	router.GET("/terms", routes.Terms)
	router.GET("/support", routes.Support)

	router.ServeFiles("/css/*filepath", http.Dir(os.Getenv("TEMPLATEPATH")+"/css"))
	router.ServeFiles("/js/*filepath", http.Dir(os.Getenv("TEMPLATEPATH")+"/js"))
	router.ServeFiles("/img/*filepath", http.Dir(os.Getenv("TEMPLATEPATH")+"/img"))

	fmt.Println(os.Getenv("TEMPLATEPATH") + "/css")

	// Apply middleware to the router
	middle.UseHandler(router)

	l.Infof("Listening at :8080")

	// Start server
	return http.ListenAndServe(":8080", middle)
}

{'fraction_non_alphanumeric': 0.17599770312948607, 'fraction_numerical': 0.0068906115417743325, 'mean_word_length': 4.477987421383648, 'pattern_counts': {'":': 2, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7262210', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1216, 'n_words': 231}