Browse Source

new sample for 2.9

Namdak Tonpa 9 years ago
parent
commit
94cc8f2ff4

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"b955fb").
+-define(VERSION,"7537c0").

BIN
mad


+ 1 - 1
priv/web/apps/sample/priv/static/spa/index.htm

@@ -17,6 +17,6 @@
     <script src='/n2o/bullet.js'></script>
     <script src='/n2o/utf8.js'></script>
     <script src='/n2o/n2o.js'></script>
-    <script> protos = [ $client ]; N2O_start(); </script>
+    <script> protos = [ $bert, $client ]; N2O_start(); </script>
 
 </body></html>

+ 1 - 2
priv/web/apps/sample/priv/templates/index.html

@@ -16,7 +16,6 @@
     <script src='/n2o/utf8.js'></script>
     <script src='/n2o/template.js'></script>
     <script src='/n2o/n2o.js'></script>
-<script>protos = [ $client ]; N2O_start();
-</script><div id="n2ostatus"></div>
+<script>protos = [ $bert, $client ]; N2O_start();</script><div id="n2ostatus"></div>
 </body>
 </html>

+ 1 - 0
priv/web/apps/sample/src/index.erl

@@ -1,5 +1,6 @@
 -module(index).
 -compile(export_all).
+-include_lib("nitro/include/nitro.hrl").
 -include_lib("n2o/include/wf.hrl").
 
 peer()    -> io_lib:format("~p",[wf:peer(?REQ)]).

+ 1 - 2
priv/web/apps/sample/src/routes.erl

@@ -1,10 +1,9 @@
 -module(routes).
--author('Maxim Sokhatsky').
 -include_lib("n2o/include/wf.hrl").
 -export([init/2, finish/2]).
 
 finish(State, Ctx) -> {ok, State, Ctx}.
-init(State, Ctx) -> 
+init(State, Ctx) ->
     Path = wf:path(Ctx#cx.req),
     wf:info(?MODULE,"Route: ~p~n",[Path]),
     {ok, State, Ctx#cx{path=Path,module=route_prefix(Path)}}.

+ 1 - 1
priv/web/apps/sample/src/sample.app.src

@@ -1,6 +1,6 @@
 {application, sample,
  [
-  {description, "N2O VXZ Sample App"},
+  {description, "N2O Sample"},
   {vsn, "1"},
   {registered, []},
   {applications, [kernel, stdlib, n2o]},

+ 0 - 2
priv/web/apps/sample/src/web_sup.erl

@@ -8,8 +8,6 @@ rules() -> cowboy_router:compile(
     [{'_', [
         {"/static/[...]", n2o_dynalo, {dir, "apps/sample/priv/static", mime()}},
         {"/n2o/[...]", n2o_dynalo, {dir, "deps/n2o/priv", mime()}},
-        {"/rest/:resource", rest_cowboy, []},
-        {"/rest/:resource/:id", rest_cowboy, []},
         {"/ws/[...]", bullet_handler, [{handler, n2o_bullet}]},
         {'_', n2o_cowboy, []}
     ]}]).

+ 9 - 8
priv/web/rebar.config

@@ -1,13 +1,14 @@
 {sub_dirs,["apps"]}.
 {deps_dir,"deps"}.
 {deps, [
-    {erlydtl,".*", {git, "git://github.com/evanmiller/erlydtl", {tag, "0.8.0"} }},
-    {cowboy, ".*", {git, "git://github.com/extend/cowboy",      {tag, "1.0.1"} }},
-    {gproc,  ".*", {git, "git://github.com/uwiger/gproc.git",   {tag, "0.3"}   }},
-    {mad,    ".*", {git, "git://github.com/synrc/mad",          {tag, "master"}   }},
-    {fs,     ".*", {git, "git://github.com/synrc/fs",           {tag, "0.8"}   }},
-    {sh,     ".*", {git, "git://github.com/synrc/sh",           {tag, "0.8"}   }},
-    {active, ".*", {git, "git://github.com/synrc/active",       {tag, "master"}   }},
-    {n2o,    ".*", {git, "git://github.com/5HT/n2o",            {tag, "master"} }}
+    {erlydtl,".*", {git, "git://github.com/evanmiller/erlydtl", {tag, "0.8.0"}  }},
+    {cowboy, ".*", {git, "git://github.com/extend/cowboy",      {tag, "1.0.1"}  }},
+    {gproc,  ".*", {git, "git://github.com/uwiger/gproc.git",   {tag, "0.3"}    }},
+    {mad,    ".*", {git, "git://github.com/synrc/mad",          {tag, "master"} }},
+    {fs,     ".*", {git, "git://github.com/synrc/fs",           {tag, "0.8"}    }},
+    {sh,     ".*", {git, "git://github.com/synrc/sh",           {tag, "0.8"}    }},
+    {active, ".*", {git, "git://github.com/synrc/active",       {tag, "master"} }},
+    {nitro,  ".*", {git, "git://github.com/synrc/nitro",        {tag, "master"} }},
+    {n2o,    ".*", {git, "git://github.com/synrc/n2o",          {tag, "master"} }}
 ]}.
 

+ 1 - 1
priv/web/sys.config

@@ -1,4 +1,4 @@
 [
- {n2o, [{port,8000},{route,routes},{log_modules,web_app}]},
+ {n2o, [{port,8001},{route,routes},{log_modules,web_app}]},
  {kvs, [{dba,store_mnesia}, {schema, [kvs_user, kvs_acl, kvs_feed, kvs_subscription ]} ]}
 ].