<commit_before>package caple

import (
	"github.com/iris-contrib/middleware/logger"
	"github.com/kataras/iris"
	"github.com/urfave/cli"
)

// StartServer starts the REST Service using Iris
func StartServer(c *cli.Context) error {
	// Store configuration globally
	setConfig(c)

	// Start server, and serve context path
	api := iris.New()
	api.Use(logger.New())
	api.Use(&apiTokenMiddleware{})
	api.Get("/caple/v1/status", statusHandler)
	api.ListenTLS(config.listenAddress, "server.cert", "server.key")

	return nil
}

// statusHandler returns the current (health)status of the service
func statusHandler(c *iris.Context) {
	c.JSON(iris.StatusOK, iris.Map{
		"status": "OK",
	})
}
<commit_msg>Clean up<commit_after>package caple

import (
	"github.com/iris-contrib/middleware/logger"
	"github.com/kataras/iris"
	"github.com/urfave/cli"
)

// StartServer starts the REST Service using Iris
func StartServer(c *cli.Context) error {
	// Store configuration globally
	setConfig(c)

	// Start server, and serve context path
	api := iris.New()

	// Set some configuration
	api.Config.LoggerPreffix = "[copper-caple] "

	// Add middlewares that process all requests before the handler
	api.Use(logger.New())
	api.Use(&apiTokenMiddleware{})

	// Add all API endpoint handlers
	api.Get("/caple/v1/status", statusHandler)

	// Start listening..
	api.ListenTLS(config.listenAddress, "server.cert", "server.key")

	// Eventually return to CLI wrapper
	return nil
}

// statusHandler returns the current (health)status of the service
func statusHandler(c *iris.Context) {
	c.JSON(iris.StatusOK, iris.Map{
		"status": "OK",
	})
}

{'fraction_non_alphanumeric': 0.1349009900990099, 'fraction_numerical': 0.0012376237623762376, 'mean_word_length': 4.319078947368421, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '191575', 'n_tokens_mistral': 563, 'n_tokens_neox': 548, 'n_words': 133}