all repos — litestore @ 707dd7955cebb561a97a9ee41ab382e381afe85d

A minimalist nosql document store.

Renamed app folder; added default version URLs.
h3rald h3rald@h3rald.com
Sat, 04 Apr 2015 20:25:37 +0200
commit

707dd7955cebb561a97a9ee41ab382e381afe85d

parent

efeb952b14624d9aab9d1c6aaaced182100adaa6

69 files changed, 10 insertions(+), 6 deletions(-)

jump to
M app/js/modules/info.jsadmin/js/modules/info.js

@@ -24,7 +24,7 @@ li("Read-Only", readonly),

li("Total Documents", m("span.badge", info.total_documents)), li("Total Tags", m("span.badge", info.total_tags)), ])]); - var logo = m(".col-md-6", [m("img", {src: "/v1/docs/app/images/litestore.png"})]); + var logo = m(".col-md-6", [m("img", {src: "images/litestore.png"})]); var taglist = m("ul.list-unstyled", info.tags.map(function(tag){ var key = Object.keys(tag)[0]; return m("li", [u.tagbutton(key, tag[key])]);
M lib/cli.nimlib/cli.nim

@@ -9,7 +9,7 @@ types,

utils const cfgfile = "litestore.nimble".slurp -const favicon = "app/favicon.ico".slurp +const favicon = "admin/favicon.ico".slurp var file*, address*, version*, appname*: string
M lib/server.nimlib/server.nim

@@ -31,6 +31,10 @@ result.headers = {"Content-Type": "image/x-icon"}.newStringTable

return result try: var info = req.parseApiUrl + if info.version == "docs" or info.version == "info": + info.version = "v1" + info.id = info.resource + info.resource = "docs" if info.version == "v1" and info.resource.match(peg"^docs / info$"): return api_v1.route(req, LS, info.resource, info.id) else:
M lib/types.nimlib/types.nim

@@ -60,7 +60,7 @@ ^[a-zA-Z0-9_\-?~:.@#^!+]+$

""" let PEG_URL* = peg""" - ^\/{(v\d+)} \/ {([^\/]+)} (\/ {(.+)} / \/?)$ + ^\/({(v\d+)} \/)? {([^\/]+)} (\/ {(.+)} / \/?)$ """ const
M lib/utils.nimlib/utils.nim

@@ -24,7 +24,7 @@ result = "SELECT "

if options.search.len > 0: if options.select[0] != "COUNT(id)": options.select.add("snippet(searchcontents) AS highlight") - options.select.add("rank(matchinfo(searchcontents, 'pcxnal'), 1.20, 0.75, 1.5, 0.5) AS rank") + options.select.add("rank(matchinfo(searchcontents, 'pcxnal'), 1.20, 0.75) AS rank") options.orderby = "rank DESC" result = result & options.select.join(", ") result = result & " FROM documents, searchcontents "
A run_admin

@@ -0,0 +1,2 @@

+#!/usr/bin/env bash +./litestore --mount:admin
D run_app

@@ -1,2 +0,0 @@

-#!/usr/bin/env bash -./litestore --mount:app