26 lines
451 B
Nim
26 lines
451 B
Nim
import asyncdispatch, bcrypt, docopt, jester, json, jwt
|
|
|
|
import personal_measure_apipkg/db
|
|
|
|
type
|
|
PersonalMeasureApiConfig = object
|
|
port*: int
|
|
pwdCost*: int
|
|
dbConnString*: string
|
|
|
|
proc start*(cfg: StrawBossConfig): void =
|
|
|
|
var stopFuture = newFuture[void]()
|
|
var workers: seq[Worker] = @[]
|
|
|
|
settings:
|
|
port = Port(cfg.port)
|
|
appName = "/api"
|
|
|
|
routes:
|
|
|
|
get "/version":
|
|
resp($(%("strawboss v" & SB_VERSION)), JSON)
|
|
|
|
|