Skip to content

Commit

Permalink
do not freeze plain text
Browse files Browse the repository at this point in the history
  • Loading branch information
khajavi committed May 8, 2024
1 parent 417c5a6 commit 477cc8b
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,15 @@ object PlainTextBenchmarkServer extends ZIOAppDefault {
// .serverTime
.addHeader(Header.Server(STATIC_SERVER_NAME))

private val frozenPlainTextResponse = Response
private def frozenPlainTextResponse = Response
.text(plainTextMessage)
// .serverTime
.addHeader(Header.Server(STATIC_SERVER_NAME))

private def plainTextApp(response: Response): Routes[Any, Response] =
Routes(Method.GET / plaintextPath -> Handler.fromResponse(response))

private def jsonApp(json: Response): Routes[Any, Response] =
Routes(Method.GET / jsonPath -> Handler.fromResponse(json))

val app: Routes[Any, Response] = plainTextApp(frozenPlainTextResponse) ++ Routes(Method.GET / jsonPath -> Handler.fromResponse(frozenJsonResponse))// ++ jsonApp(frozenJsonResponse)
val app: Routes[Any, Response] = Routes(Method.GET / plaintextPath -> Handler.fromResponse(frozenPlainTextResponse)) ++ Routes(Method.GET / jsonPath -> Handler.fromResponse(frozenJsonResponse))// ++ jsonApp(frozenJsonResponse)

private val config = Server.Config.default
.port(8080)
Expand Down

0 comments on commit 477cc8b

Please sign in to comment.