File tree Expand file tree Collapse file tree
src/main/scala/net/yoshinorin/qualtet Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import net.yoshinorin.qualtet.http.routes.{
2626import net .yoshinorin .qualtet .http .routes .CacheRoute
2727import org .http4s .ember .server .EmberServerBuilder
2828import com .comcast .ip4s .*
29+ import org .http4s .server .middleware .ResponseTiming
2930
3031// import scala.io.StdIn
3132
@@ -74,8 +75,11 @@ object BootStrap extends IOApp {
7475
7576 Modules .migrator.migrate(Modules .contentTypeService)
7677
78+ // NOTE: https://github.com/http4s/http4s/blob/v1.0.0-M40/server/shared/src/main/scala/org/http4s/server/middleware/ResponseTiming.scala
79+ // https://github.com/http4s/http4s/blob/v1.0.0-M40/server/shared/src/main/scala/org/http4s/server/middleware/ResponseLogger.scala
80+ val responseTiming = ResponseTiming (router.routes)
7781 // TODO: filter & format log
78- val httpAppWithLogger : HttpApp [IO ] = Logger .httpApp(true , false )(router.routes )
82+ val httpAppWithLogger : HttpApp [IO ] = Logger .httpApp(logHeaders = true , logBody = false )(responseTiming )
7983
8084 val host = Ipv4Address .fromString(Modules .config.http.host).getOrElse(ipv4 " 127.0.0.1 " )
8185 val port = Port .fromInt(Modules .config.http.port).getOrElse(port " 9001 " )
You can’t perform that action at this time.
0 commit comments