<commit_before>package kafka.console
package service

import journal.Logger
import org.http4s.dsl._

import scalaz.Kleisli
import kafka.console.app._
import org.http4s.headers.`Content-Type`

object Application {

  import content._, codecs._
  import syntax._
  import errors._
  import app._

  implicit val logger = Logger[this.type]

  private val status = raw {
    case GET -> Root / "status" => Ok("works just fine")
  }

  private val topics = exec {
    case GET -> Root / "topics" =>
       topicService andThen getTopics
  }

  private val html = raw {
    case GET -> Root / "html" => {
      import scalaz.concurrent.Task

      org.http4s.StaticFile.fromResource("/webpage.html").fold(NotFound())(Task.now)
    }
  }

  private val authenticated = auth {
    case GET -> Root / "auth" / "topics" =>
      token => for {
        _ <- info(s"request to secured resource with token $token")
        r <- topicService andThen getTopics
      } yield r
  }

  val instance: Controller = status orElse topics orElse authenticated orElse html
}<commit_msg>replaced io.linesR with StaticFile<commit_after>package kafka.console
package service

import journal.Logger
import org.http4s.dsl._

import scalaz.Kleisli
import kafka.console.app._
import org.http4s._

object Application {

  import content._, codecs._
  import syntax._
  import errors._
  import app._

  implicit val logger = Logger[this.type]

  private val status = raw {
    case GET -> Root / "status" => Ok("works just fine")
  }

  private val topics = exec {
    case GET -> Root / "topics" =>
       topicService andThen getTopics
  }

  private val html = raw {
    case GET -> Root / "html" => {
      import scalaz.concurrent.Task

      StaticFile.fromResource("/webpage.html").fold(NotFound())(Task.now)
    }
  }

  private val authenticated = auth {
    case GET -> Root / "auth" / "topics" =>
      token => for {
        _ <- info(s"request to secured resource with token $token")
        r <- topicService andThen getTopics
      } yield r
  }

  val instance: Controller = status orElse topics orElse authenticated orElse html
}
{'fraction_non_alphanumeric': 0.10449172576832151, 'fraction_numerical': 0.002364066193853428, 'mean_word_length': 2.8126126126126128, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, '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': '4938918', 'n_tokens_mistral': 665, 'n_tokens_neox': 632, 'n_words': 195}