This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Combinators | |
// These are basic combinators that work with ASP.NET HttpContext. | |
// Feel free to add your own. | |
// | |
// most of this adapted from Giraffe v0.1.0-alpha025 | |
// https://github.com/dustinmoris/Giraffe/blob/v0.1.0-alpha025/src/Giraffe/HttpHandlers.fs | |
// Some combinators adapted from Suave | |
// https://github.com/SuaveIO/suave | |
// Both projects are Apache 2.0 Licensed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FileUtils exposing (..) | |
import Native.FileUtils | |
import Html exposing (..) | |
import Html.Events exposing (..) | |
import Http exposing (Body) | |
import Json.Decode as Json | |
type alias File = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Try to setup auto logout. But JWT parsing can fail in several ways. | |
-- | |
-- Failure strategy: | |
-- 1. Console log failure. | |
-- 2. The fallback (not shown below) is to instruct the user to | |
-- manually log out and back in when we receive 401 Unauthorized. | |
-- | |
-- TODO send failure to logging infrastructure. | |
notifyOnExpired : String -> Cmd Msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port module Api exposing (..) | |
import JsonStuff exposing (ToJson, FromJson, getEncoder, getDecoder) | |
import Http | |
helpPostJson : String -> ToJson a msg -> FromJson b msg -> a -> Http.Request b | |
helpPostJson url toJson fromJson o = | |
Http.request | |
{ method = "POST" | |
, headers = [] |
NewerOlder