api: WIP CORS supoport

This commit is contained in:
2019-09-24 22:41:25 -05:00
parent 0a8f701c3c
commit cf60793395
6 changed files with 22 additions and 8 deletions

View File

@ -9,6 +9,7 @@ type
debug*: bool
port*: int
pwdCost*: int8
knownOrigins*: seq[string]
PMApiContext* = object
cfg*: PMApiConfig
@ -23,7 +24,8 @@ proc `%`*(cfg: PMApiConfig): JsonNode =
"dbConnString": cfg.dbConnString,
"debug": cfg.debug,
"port": cfg.port,
"pwdCost": cfg.pwdCost }
"pwdCost": cfg.pwdCost,
"knownOrigins": cfg.knownOrigins }
template raiseEx*(errorType: type, reason: string): void =
raise newException(errorType, reason)