lib-0.js 743 B

123456789101112131415161718192021222324252627282930
  1. /* appjet:version 0.1 */
  2. /* appjet:library */
  3. // (c) 2009, Herbert Vojčík
  4. // Licensed by MIT license (http://www.opensource.org/licenses/mit-license.php)
  5. import("lib-app/liveui", "lib-app/mvp");
  6. page.setView(box(
  7. H1("Default page"),
  8. sub(data("missingDomain"), box(P("Cannot find handler for domain: ", data())))
  9. ));
  10. function get_main() {
  11. page.setViewModel({missingDomain:request.headers.Host});
  12. }
  13. import("storage");
  14. function get_localhostsetup() {
  15. if (!storage.bootTable) { storage.bootTable = {}; }
  16. storage.bootTable["localhost:8080"] = request.query;
  17. page.setView(P("Localhost setup successful"));
  18. }
  19. import("lib-app/../../config");
  20. import("lib-utils/patches");
  21. dispatchShouldSearchHere();
  22. mvp();
  23. response.setStatusCode(404);