all repos — litestore @ 45266db650f5835b6cb2f82a1da295aa5499916a

A minimalist nosql document store.

Fixed support for accessing items in other stores with high level programmatic API.
h3rald h3rald@h3rald.com
Mon, 04 May 2020 17:35:13 +0200
commit

45266db650f5835b6cb2f82a1da295aa5499916a

parent

4be7b55fab54020be52ebbdacb170efd388dbfeb

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

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

@@ -1004,6 +1004,7 @@ proc route*(req: LSRequest, LS: LiteStore, resource = "docs", id = ""): LSResponse =

var reqMethod = $req.reqMethod if req.headers.hasKey("X-HTTP-Method-Override"): reqMethod = req.headers["X-HTTP-Method-Override"] + LOG.debug("ROUTE - resource: " & resource & " id: " & id) case reqMethod.toUpperAscii: of "POST": if LS.readonly:

@@ -1034,9 +1035,9 @@ proc multiRoute(req: LSRequest, resource, id: string): LSResponse =

var matches = @["", "", ""] if req.url.path.find(PEG_STORE_URL, matches) != -1: let id = matches[0] - let path = matches[1] + let path = "/v7/" & matches[1] matches = @["", "", ""] - discard path.find(PEG_URL) + discard path.find(PEG_URL, matches) return req.route(LSDICT[id], matches[1], matches[2]) return req.route(LS, resource, id)