Browse Source

Environment variables (sys.config)

221V 1 year ago
parent
commit
ff703e0682
2 changed files with 4 additions and 0 deletions
  1. 3 0
      apps/n2o_sample/src/index.erl
  2. 1 0
      sys.config

+ 3 - 0
apps/n2o_sample/src/index.erl

@@ -32,6 +32,9 @@ body() ->
   [ #span{id=upload}, #button{id=send, body= <<"Chat">>, postback=chat, source=[message] } ].
 
 event(init) ->
+  %wf:config(n2o, appurl, undefined) %% App, Key, DefaulValue
+  io:format("~p~n", [wf:config(n2o, appurl, undefined)]),
+  
   Room = code(),
   wf:update(upload, #upload{id=upload}),
   wf:reg(n2o_session:session_id()),

+ 1 - 0
sys.config

@@ -3,6 +3,7 @@
         %{websocket_port,443},
         {websocket_port,4000}, % same as port for localhost test
         {app,n2o_sample},
+        {appurl, <<"https://mybesttestapp.win/">>},
         {upload,"./apps/n2o_sample/priv/static/"},
         {search,"/Users/5HT/depot/synrc/synrc.com/apps/*/doc/web/*.htm"},
         {mode,dev},