Skip to content

Instantly share code, notes, and snippets.

@Krzysztof-Cieslak
Last active August 3, 2018 22:08
Show Gist options
  • Save Krzysztof-Cieslak/d32be21f6f55e52ddd09569cd3d5a35e to your computer and use it in GitHub Desktop.
Save Krzysztof-Cieslak/d32be21f6f55e52ddd09569cd3d5a35e to your computer and use it in GitHub Desktop.
Gists for "Using OAuth with Saturn" blog posts
module Server
open Saturn
open Config
let endpointPipe = pipeline {
plug head
plug requestId
}
let app = application {
pipe_through endpointPipe
error_handler (fun ex _ -> pipeline { render_html (InternalError.layout ex) })
use_router Router.appRouter
url "http://0.0.0.0:5000/"
memory_cache
use_static "static"
use_gzip
use_config (fun _ -> {connectionString = "DataSource=database.sqlite"} ) //TODO: Set development time configuration
use_github_oauth "CLIENT_ID" "SECRET_KEY" "/signin-github" [("login", "githubUsername"); ("name", "fullName")]
}
[<EntryPoint>]
let main _ =
printfn "Working directory - %s" (System.IO.Directory.GetCurrentDirectory())
run app
0 // return an integer exit code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment