all repos — litestore @ 79001faf5b7061114fd14dfebbb4449bf77baa78

A minimalist nosql document store.

Merge branch 'master' of https://github.com/h3rald/litestore
h3rald h3rald@h3rald.com
Mon, 30 Sep 2019 13:28:22 +0200
commit

79001faf5b7061114fd14dfebbb4449bf77baa78

parent

aa67a3337a92da50ffe519392a87b2629075b882

3 files changed, 5 insertions(+), 1 deletions(-)

jump to
M src/litestorepkg/lib/api_v4.nimsrc/litestorepkg/lib/api_v4.nim

@@ -477,6 +477,7 @@ if not folder.isFolder:

return resError(Http400, "Invalid folder specified when creating document: $1" % folder) try: var doc = LS.store.createDocument(folder, body, ct) + echo doc if doc != "": result.headers = ctJsonHeader() setOrigin(LS, req, result.headers)

@@ -485,6 +486,7 @@ result.code = Http201

else: result = resError(Http500, "Unable to create document.") except: + eWarn() result = resError(Http500, "Unable to create document.") proc putDocument*(LS: LiteStore, id: string, body: string, ct: string, req: LSRequest): LSResponse =
M src/litestorepkg/lib/core.nimsrc/litestorepkg/lib/core.nim

@@ -99,12 +99,14 @@ if LS_TRANSACTION:

LOG.debug("Committing transaction") LS_TRANSACTION = false store.db.exec("COMMIT".sql) + LOG.debug("Committed.") proc rollback(store: Datastore) = if LS_TRANSACTION: LOG.debug("Rolling back transaction") LS_TRANSACTION = false store.db.exec("ROLLBACK".sql) + LOG.debug("Rolled back.") # Manage Tags
M src/litestorepkg/lib/utils.nimsrc/litestorepkg/lib/utils.nim

@@ -25,7 +25,7 @@ elif req.headers.hasKey("origin"):

let parts = req.headers["origin"].split("://") protocol = parts[0] let server = parts[1].split(":") - if (parts.len >= 2): + if (server.len >= 2): host = server[0] port = server[1] else: