Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed May 29, 2024
1 parent 1d31608 commit ce23d1f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 64 deletions.
18 changes: 0 additions & 18 deletions project/src/ETagMiddleware.scala
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import scala.concurrent.duration.DurationInt

import org.http4s.Header
import org.http4s.HttpApp
import org.http4s.HttpRoutes
import org.http4s.Request
import org.http4s.Response
import org.http4s.ServerSentEvent
import org.http4s.Status
import org.http4s.scalatags.*
import org.http4s.dsl.io.*
import org.http4s.implicits.*
import org.http4s.server.Router
import org.http4s.server.staticcontent.*
import org.http4s.server.staticcontent.FileService
import org.typelevel.ci.CIStringSyntax

import fs2.*
import fs2.concurrent.Topic
import fs2.io.file.Files

import scribe.Scribe

Expand All @@ -26,15 +15,8 @@ import cats.data.OptionT
import cats.effect.*
import cats.effect.IO
import cats.effect.kernel.Ref
import cats.effect.kernel.Resource
import cats.syntax.all.*

import _root_.io.circe.syntax.EncoderOps
import java.time.Instant
import java.time.format.DateTimeFormatter
import java.time.ZonedDateTime
import java.time.ZoneId

object ETagMiddleware:

def apply(service: HttpRoutes[IO], mr: Ref[IO, Map[String, String]])(logger: Scribe[IO]): HttpRoutes[IO] = Kleisli {
Expand Down
7 changes: 0 additions & 7 deletions project/src/routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import org.http4s.HttpRoutes
import org.http4s.Request
import org.http4s.Response
import org.http4s.ServerSentEvent
import org.http4s.Status
import org.http4s.dsl.io.*
import org.http4s.implicits.*
import org.http4s.scalatags.*
import org.http4s.server.Router
import org.http4s.server.staticcontent.*
import org.http4s.server.staticcontent.FileService
import org.typelevel.ci.CIStringSyntax

import fs2.*
import fs2.concurrent.Topic
Expand All @@ -30,11 +28,6 @@ import cats.effect.kernel.Resource
import cats.syntax.all.*

import _root_.io.circe.syntax.EncoderOps
import java.time.Instant
import java.time.format.DateTimeFormatter
import java.time.ZonedDateTime
import java.time.ZoneId
import cats.instances.map

def routes(
stringPath: String,
Expand Down
48 changes: 18 additions & 30 deletions project/src/static.watcher.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
import java.time.Instant
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter

import scala.concurrent.duration.*

import org.http4s.Header
import org.http4s.HttpRoutes
import org.http4s.Request
import org.http4s.Response
import org.http4s.Status
import org.http4s.dsl.io.*
import org.typelevel.ci.CIStringSyntax

import fs2.*
import fs2.concurrent.Topic
import fs2.io.Watcher
Expand All @@ -7,45 +22,18 @@ import fs2.io.Watcher.Event.Deleted
import fs2.io.Watcher.Event.Modified
import fs2.io.Watcher.Event.NonStandard
import fs2.io.Watcher.Event.Overflow

import org.http4s.Header
import org.http4s.HttpApp
import org.http4s.HttpRoutes
import org.http4s.Request
import org.http4s.Response
import org.http4s.ServerSentEvent
import org.http4s.Status
import org.http4s.scalatags.*
import org.http4s.dsl.io.*
import org.http4s.implicits.*
import org.http4s.server.Router
import org.http4s.server.staticcontent.*
import org.http4s.server.staticcontent.FileService
import org.typelevel.ci.CIStringSyntax
import fs2.io.file.Path

import scribe.Scribe

import cats.effect.IO
import cats.effect.OutcomeIO
import cats.effect.ResourceIO
import cats.data.Kleisli
import cats.data.OptionT
import cats.effect.*
import cats.effect.IO
import cats.effect.kernel.Ref
import cats.effect.kernel.Resource
import cats.effect.OutcomeIO
import cats.effect.ResourceIO
import cats.syntax.all.*

import scala.concurrent.duration.*
import cats.effect.std.MapRef
import fs2.io.file.Path
import cats.data.OptionT
import java.util.Date
import java.time.format.DateTimeFormatter
import java.time.ZonedDateTime
import java.time.Instant
import java.time.ZoneId

def staticWatcher(
refreshTopic: Topic[IO, Unit],
staticDir: fs2.io.file.Path
Expand Down
12 changes: 3 additions & 9 deletions project/test/src/RoutesSpec.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import java.security.MessageDigest
import java.time.Instant
import java.time.ZoneId
import java.time.ZonedDateTime

import scala.concurrent.duration.*


import org.http4s.HttpRoutes
import org.typelevel.ci.CIStringSyntax

Expand All @@ -15,14 +17,6 @@ import cats.effect.std.MapRef

import munit.CatsEffectSuite


import scala.concurrent.duration.*
import scribe.Level
import java.time.ZonedDateTime
import java.time.ZoneId
import java.time.Instant


class RoutesSuite extends CatsEffectSuite:

val md = MessageDigest.getInstance("MD5")
Expand Down

0 comments on commit ce23d1f

Please sign in to comment.