Add more info to /.tokens endpoint
This commit is contained in:
10
src/routes/debug.nim
Normal file
10
src/routes/debug.nim
Normal file
@@ -0,0 +1,10 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
import jester
|
||||
import router_utils
|
||||
import ".."/[tokens, types]
|
||||
|
||||
proc createDebugRouter*(cfg: Config) =
|
||||
router debug:
|
||||
get "/.tokens":
|
||||
cond cfg.enableDebug
|
||||
respJson getPoolJson()
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
import strutils, sequtils, uri, tables
|
||||
import strutils, sequtils, uri, tables, json
|
||||
from jester import Request, cookies
|
||||
|
||||
import ../views/general
|
||||
@@ -43,5 +43,5 @@ template getCursor*(req: Request): string =
|
||||
proc getNames*(name: string): seq[string] =
|
||||
name.strip(chars={'/'}).split(",").filterIt(it.len > 0)
|
||||
|
||||
template respJson*(body: string) =
|
||||
resp body, "application/json"
|
||||
template respJson*(node: JsonNode) =
|
||||
resp $node, "application/json"
|
||||
|
||||
Reference in New Issue
Block a user