Get the environment variable properly
This commit is contained in:
parent
b86adff83d
commit
f921d7b123
@ -12,10 +12,10 @@ open Giraffe
|
|||||||
open dotenv.net
|
open dotenv.net
|
||||||
open Npgsql.FSharp
|
open Npgsql.FSharp
|
||||||
|
|
||||||
let prodEnv = DotEnv.Read(DotEnvOptions(envFilePaths = [ "../.prod.env"], overwriteExistingVars = false))
|
DotEnv.Load(DotEnvOptions(envFilePaths = [ "../.prod.env" ], overwriteExistingVars = false))
|
||||||
|
|
||||||
let ( _ , connStr ) = prodEnv.TryGetValue("DATABASE_URL")
|
let connStr = Environment.GetEnvironmentVariable("DATABASE_URL")
|
||||||
let ( _ , apiKey ) = prodEnv.TryGetValue("API_KEY")
|
let apiKey = Environment.GetEnvironmentVariable("API_KEY")
|
||||||
|
|
||||||
let validateApiKey (ctx : HttpContext) =
|
let validateApiKey (ctx : HttpContext) =
|
||||||
match ctx.TryGetRequestHeader "X-API-Key" with
|
match ctx.TryGetRequestHeader "X-API-Key" with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user