all repos — litestore @ 1e408c9bc74fd5d25e84ac4a6642cd8ab93e5405

A minimalist nosql document store.

Fixes & improvements.
h3rald h3rald@h3rald.com
Tue, 17 Mar 2020 09:54:28 +0100
commit

1e408c9bc74fd5d25e84ac4a6642cd8ab93e5405

parent

1960bb2d610ca3ada395c1abfc43fa88de19a0de

2 files changed, 14 insertions(+), 6 deletions(-)

jump to
M src/litestore.nimsrc/litestore.nim

@@ -59,7 +59,6 @@ req.headers["Content-Type"] = ctype

req.hostname = "<cli>" req.url = parseUri("$1://$2:$3/$4" % @["http", "localhost", "9500", uri]) let resp = req.process(LS) - echo resp.content if resp.code.int < 300 and resp.code.int >= 200: quit(0) else:
M src/litestorepkg/lib/server.nimsrc/litestorepkg/lib/server.nim

@@ -12,7 +12,8 @@ tables,

strtabs, base64, asyncnet, - jwt + jwt, + sequtils import types, utils,

@@ -297,15 +298,23 @@ var newReq = newRequest(req, client)

await newReq.respond(res.code, res.content, res.headers) echo(LS.appname & " v" & LS.appversion & " started on " & LS.address & ":" & $LS.port & ".") if LS.configFile != "": - echo "- Configuration File: " & LS.configFile + echo "- Configuration file: " & LS.configFile if LS.authFile != "": - echo "- Auth File: " & LS.authFile + echo "- Auth file: " & LS.authFile if LS.mount: echo "- Mirroring datastore changes to: " & LS.directory + elif LS.directory != "": + echo "- Serving directory: " & LS.directory if LS.readonly: echo "- Read-only mode" - echo "- Log Level: " & LS.loglevel - echo "- Store: " & LS.file + echo "- Log level: " & LS.loglevel + echo "- Stores:" + let storeIds = toSeq(LSDICT.keys) + for i in countdown(storeIds.len-1, 0): + let file = LSDICT[storeIds[i]].file + echo " - $1: $2" % [storeIds[i], file] + if LS.middleware.len > 0: + echo "- Middleware configured" if LS.auth != newJNull(): echo "- Authorization configured" asyncCheck server.serve(LS.port.Port, handleHttpRequest, LS.address)