<commit_before>package xyz.exemplator.exemplator;

/**
 * @author LeanderK
 * @version 1.0
 */
public class Router {
    public void init() {
        RatpackServer.start(server -> server
        )
    }
}<commit_msg>router: added barebones router<commit_after>package xyz.exemplator.exemplator;

import ratpack.server.RatpackServer;
import ratpack.server.ServerConfig;

/**
 * @author LeanderK
 * @version 1.0
 */
public class Router {
    private final int port;

    public Router(int port) {
        this.port = port;
    }

    public void init() throws Exception {
        RatpackServer.start(server -> server
                .serverConfig(ServerConfig.embedded().port(port))
                .handlers(chain ->
                        chain.all(ctx -> {
                            ctx.getResponse().getHeaders().add("access-control-allow-origin", "*");
                            ctx.getResponse().getHeaders().add("access-control-allow-methods", "GET,PUT,POST,PATCH,DELETE,OPTIONS");
                            ctx.getResponse().getHeaders().add("access-control-allow-credentials", "true");
                            ctx.getResponse().getHeaders().add("access-control-allow-headers", "Authorization,Content-Type");
                            ctx.getResponse().getHeaders().add("access-control-expose-headers", "Link,Location");
                            ctx.getResponse().getHeaders().add("access-control-max-age", "86400");
                        })
                        .get("index", ctx -> ctx.render("Hello"))
                )
        );
    }
}
{'fraction_non_alphanumeric': 0.14094387755102042, 'fraction_numerical': 0.005739795918367347, 'mean_word_length': 1.9885714285714287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '4435704', 'n_tokens_mistral': 435, 'n_tokens_neox': 416, 'n_words': 63}