setup.tex 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. \section{Setup}
  2. \subsection{Installing Binary}
  3. Fresh version of mad included as a binary in its primary github repository:
  4. \vspace{1\baselineskip}
  5. \begin{lstlisting}
  6. # curl -fsSL https://raw.github.com/synrc/mad/master/mad > mad \
  7. && chmod +x mad \
  8. && sudo cp /usr/local/bin
  9. \end{lstlisting}
  10. \vspace{1\baselineskip}
  11. Or you may want to add mad to your PATH.
  12. \subsection{Compiling Sources}
  13. If you want you can compile mad by yourself:
  14. \vspace{1\baselineskip}
  15. \begin{lstlisting}
  16. # git clone http://github.com/synrc/mad \
  17. && cd mad \
  18. && make
  19. \end{lstlisting}
  20. \vspace{1\baselineskip}
  21. Note that mad uses mad to build mad. It's mad.
  22. \subsection{Creating a sample N2O project}
  23. mad also comes with N2O templates. So you can bootstrap a N2O-based site
  24. just having a single copy of mad binary.
  25. \vspace{1\baselineskip}
  26. \begin{lstlisting}
  27. # mad app sample
  28. # cd sample
  29. # mad deps compile release sample
  30. \end{lstlisting}
  31. \vspace{1\baselineskip}
  32. After that you can just run escript web\_app under Windows, Linux and
  33. Mac and open \footahref{http://localhost:8000}{http://localhost:8000}.
  34. \vspace{1\baselineskip}
  35. \begin{lstlisting}
  36. C:\> escript sample
  37. Applications: [kernel,stdlib,crypto,cowlib,ranch,
  38. cowboy,compiler,syntax_tools,
  39. erlydtl,gproc,xmerl,n2o,sample,
  40. fs,active,mad,sh]
  41. Configuration: [{n2o,[{port,8000},
  42. {route,routes}]},
  43. {kvs,[{dba,store_mnesia},
  44. {schema,[kvs_user,
  45. kvs_acl,
  46. kvs_feed,
  47. kvs_subscription]}]}]
  48. Erlang/OTP 17 [erts-6.0] [64-bit] [smp:4:4]
  49. [async-threads:10] [kernel-poll:false]
  50. Eshell V6.0 (abort with ^G)
  51. 1>
  52. \end{lstlisting}
  53. \vspace{1\baselineskip}