<commit_before>defmodule Wobserver.Web.Router.Static do
  @moduledoc ~S"""
  Static router mostly for the browsers interface.

  Returns the following resources:
    - `/`, for the main html page.
    - `/main.css`, for main css stylesheet.
    - `/app.js`, for the Javascript code.
    - `/license`, for the *MIT* license information.
  """

  use Wobserver.Web.Router.Base

  alias Wobserver.Assets

  get "/" do
    conn
    |> put_resp_content_type("text/html")
    |> send_asset("assets/index.html", &Assets.html/0);
  end

  get "/main.css" do
    conn<commit_msg>Redirect wobserver to correct endpoint. (See: #6)<commit_after>defmodule Wobserver.Web.Router.Static do
  @moduledoc ~S"""
  Static router mostly for the browsers interface.

  Returns the following resources:
    - `/`, for the main html page.
    - `/main.css`, for main css stylesheet.
    - `/app.js`, for the Javascript code.
    - `/license`, for the *MIT* license information.
  """

  use Wobserver.Web.Router.Base

  alias Wobserver.Assets

  get "/" do
    case String.ends_with?(conn.request_path, "/") do
      true ->
        conn
        |> put_resp_content_type("text/html")
        |> send_asset("assets/index.html", &Assets.html/0);
      false ->
        conn
        |> put_resp_header("location", conn.request_path <> "/")
        |> resp(301, "Redirecting to Wobserver.")
    end
  end

  get "/main.css" do
    conn
{'fraction_non_alphanumeric': 0.13432835820895522, 'fraction_numerical': 0.0042643923240938165, 'mean_word_length': 2.6858638743455496, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 12, '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': '6699935', 'n_tokens_mistral': 481, 'n_tokens_neox': 443, 'n_words': 122}