<commit_before>package com.michaelsnowden.juniper;

import spark.ModelAndView;
import spark.Request;
import spark.Response;
import spark.TemplateViewRoute;
import spark.template.freemarker.FreeMarkerEngine;

import java.util.HashMap;
import java.util.Map;

import static spark.Spark.*;

/**
 * @author michael.snowden
 */
public class Main {

    public static void main(String[] args) {

        port(Integer.valueOf(System.getenv("PORT")));
        staticFileLocation("/public");

//        get("/balance", new Route() {
//            @Override
//            public Object handle(Request req, Response res) throws Exception {
//                final String equation = req.queryParams("equation");
//                System.out.println(equation);
//                return Balancer.balance(new StringInputStream(equation));
//            }
//        });

        get("/", new TemplateViewRoute() {
            @Override
            public ModelAndView handle(Request request, Response response) {
                Map<String, String> attributes = new HashMap<>();
                final String equation = request.queryParams("equation");
                if (equation != null) {
                    attributes.put("equation", equation);
                } else {
                    attributes.put("equation", "");
                }
                return new ModelAndView(attributes, "index.ftl");
            }
        }, new FreeMarkerEngine());
    }<commit_msg>fixing heroku crap<commit_after>package com.michaelsnowden.juniper;

import spark.ModelAndView;
import spark.Request;
import spark.Response;
import spark.TemplateViewRoute;
import spark.template.freemarker.FreeMarkerEngine;

import java.util.HashMap;
import java.util.Map;

import static spark.Spark.*;

/**
 * @author michael.snowden
 */
public class Main {

    public static void main(String[] args) {

        port(Integer.valueOf(System.getenv("PORT")));
        staticFileLocation("/public");

//        get("/balance", new Route() {
//            @Override
//            public Object handle(Request req, Response res) throws Exception {
//                final String equation = req.queryParams("equation");
//                System.out.println(equation);
//                return Balancer.balance(new StringInputStream(equation));
//            }
//        });

        get("/", new TemplateViewRoute() {
            @Override
            public ModelAndView handle(Request request, Response response) {
                Map<String, String> attributes = new HashMap<>();
                final String equation = request.queryParams("equation");
                if (equation != null) {
                    attributes.put("equation", Balancer.balance(equation));
                } else {
                    attributes.put("equation", "");
                }
                return new ModelAndView(attributes, "index.ftl");
            }
        }, new FreeMarkerEngine());
    }
{'fraction_non_alphanumeric': 0.12190152801358234, 'fraction_numerical': 0.0, 'mean_word_length': 2.0945378151260505, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '820534', 'n_tokens_mistral': 736, 'n_tokens_neox': 712, 'n_words': 168}