Skip to content

Commit

Permalink
fix issues with service
Browse files Browse the repository at this point in the history
  • Loading branch information
RawToast committed Apr 1, 2018
1 parent 1a5db4a commit 5e3b80b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dokusho-server/src/main/scala/Main.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cats.effect.IO
import dokusho.middleware.Auth0Middleware
import dokusho.{MongoRepository, ReadingHistoryRouter, ReadingHistoryService}
import dokusho.{MongoRepository, ReadingHistoryRouter, AltReadingHistoryRouter, ReadingHistoryService}
import fs2.StreamApp.ExitCode
import fs2.{Stream, StreamApp}
import org.http4s.client.Client
Expand All @@ -24,9 +24,9 @@ object Main extends StreamApp[IO] {

val readingHistoryService = new ReadingHistoryService(mongo)
val historyService: ReadingHistoryRouter = new ReadingHistoryRouter(readingHistoryService)
val altHistoryService: ReadingHistoryRouter = new AltReadingHistoryRouter(readingHistoryService)
val altHistoryService = new AltReadingHistoryRouter(readingHistoryService)

val authHistory = authMiddleware.authenticationMiddleware(historyService.routes)
val authHistory = authMiddleware.authenticationMiddleware(altHistoryService.routes)


override def stream(args: List[String], requestShutdown: IO[Unit]): Stream[IO, ExitCode] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ReadingHistoryRouter(readingHistoryService: ReadingHistoryService) extends
readingHistoryService.reset(userId)
.map(_.asJson)
.flatMap(j => Ok(j))
}
}

class AltReadingHistoryRouter(readingHistoryService: ReadingHistoryService) extends Http4sRouter {
Expand Down Expand Up @@ -86,10 +87,4 @@ class AltReadingHistoryRouter(readingHistoryService: ReadingHistoryService) exte
Ok("Hello world: " + headerOpt.value)
}
}
}

}




0 comments on commit 5e3b80b

Please sign in to comment.