Skip to content

Commit

Permalink
Url amendments, really we need config...
Browse files Browse the repository at this point in the history
  • Loading branch information
RawToast committed Apr 1, 2018
1 parent 5e3b80b commit ebec7d7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dokusho-server/src/main/scala/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object Main extends StreamApp[IO] {
BlazeBuilder[IO]
.bindHttp(8080, "0.0.0.0")
.mountService(historyService.routes, "/")
.mountService(authHistory, "/authed")
.mountService(authHistory, "/authed/")
.withBanner(ServerBuilder.DefaultBanner)
.serve
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AltReadingHistoryRouter(readingHistoryService: ReadingHistoryService) exte
IO(req.headers.find(_.name == CaseInsensitiveString("User")).map(_.value))

implicit private def routeWithErrorHandling(io: OptionT[IO, IO[Response[IO]]]): IO[Response[IO]] =
io.value.flatMap(_.getOrElse(Ok("Hey")))
io.value.flatMap(_.getOrElse(NotFound()))

val routes: HttpService[IO] = HttpService[IO] {
case req@GET -> Root / "history" =>
Expand Down
6 changes: 3 additions & 3 deletions dokusho/src/app/Client.re
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Client = {
let userHistory = (userId:string) => {
Js.Console.log("Get history " ++ accessToken());
Js.Promise.(
Fetch.fetchWithInit(backendURI ++ "/history/" ++ userId,
Fetch.fetchWithInit(backendURI ++ "/authed/history",
Fetch.RequestInit.make(
~method_=Get,
~headers=authHeader(),
Expand All @@ -39,7 +39,7 @@ module Client = {
/* Adds a new reading entry for today to a user's reading history */
let newEntry = (userId:string, kind: pageType, value: int) => {
Js.Promise.(
Fetch.fetchWithInit(backendURI ++ "/history/" ++ userId ++ "/add",
Fetch.fetchWithInit(backendURI ++ "/authed/history/add",
Fetch.RequestInit.make(
~method_=Post,
~body=Fetch.BodyInit.make(Encoders.endcodeInput(kind, value) |> Js.Json.stringify),
Expand All @@ -53,7 +53,7 @@ module Client = {
/* Resets a user's reading history */
let resetUser = (userId:string) => {
Js.Promise.(
Fetch.fetchWithInit(backendURI ++ "/history/" ++ userId ++ "/reset",
Fetch.fetchWithInit(backendURI ++ "/authed/history/reset",
Fetch.RequestInit.make(
~method_=Put,
~headers=authHeader(),
Expand Down
1 change: 1 addition & 0 deletions dokusho/src/app/LoginButton.re
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module Auth {
let authOptions = {
"domain": "dokusho.eu.auth0.com",
"clientID": "mal13rQ1KYJSpAjTBvs72ioa8xhnq8wh",
/* "redirectUri": "http://35.189.106.56:3000/callback", */
"redirectUri": "http://localhost:3000/callback",
"responseType": "token id_token",
"scope": "openid"
Expand Down

0 comments on commit ebec7d7

Please sign in to comment.