all repos — litestore @ 9cdae4f65883217af04ec93b9310bff1e5eafebc

A minimalist nosql document store.

admin/js/app.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
(function(){
  'use strict';
  var app = window.LS || (window.LS = {});
  
  app.flash = m.prop();
  app.system = {};
  m.route.mode = "hash";
  
  app.init = function(info){
    app.system = info;
    m.route(document.body, "/info", {
      "/info": app.info,
      "/tags/:id": app.tags,
      "/document/:action/:id...": app.document,
      "/guide/:id": app.guide,
      "/new": app.create,
      "/search/:q": app.search,
      "/search/:q/:page": app.search,
      "/search/:q/:page/:limit": app.search
    });
  };
  Info.get().then(app.init);
  
}());