-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
122 lines (104 loc) · 3.61 KB
/
index.html
File metadata and controls
122 lines (104 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="Maxim Sokhatsky" />
<title>NITRO</title>
<link rel="stylesheet" href="https://n2o.dev/blank.css?x=12"/>
<link rel="stylesheet" href="https://n2o.dev/zima.css?x=12"/>
</head>
<body>
<nav>
<a href='https://n2o.dev/tech'>TECH</a>
<a href='https://o3.github.io/nitro/'>O3</a>
<a href='#'>NITRO</a>
</nav>
<header>
<a href="https://o3.github.io/nitro/"><img src="https://avatars.githubusercontent.com/u/45380730?s=200&v=4"></a>
<h1>NITRO</h1>
</header>
<aside>
<article>
<section>
<h3>SYNOPSIS</h3>
<div>NITRO is the N2O protocol that implements Nitrogen Web Framework API.
</div>
</section>
<section>
<a name=plugin><h3>MODULES</h3></a>
<div><ul>
<li><a href="man/types.htm">Web.Nitro.Types</a></font></li>
</ul></div>
<br/>
<div>
2018 © <a href="https://github.com/o3/nitro">Marat Khafizov</a> BSD 3-clause
</div>
</section>
<section>
<figure>
<code>
git clone https://github.com/xafizoff/n2o && cd n2o
stack build && stack exec n2o-sample
open http://localhost:3000/samples/static/index.html
</code>
</figure>
</section>
</article>
</aside>
<main>
<section>
<h3>N2O Haskell</h3>
<p>The philosophy behind N2O is a simplicity, cleanness, and purity.
The core of N2O should be no more than 500 LOC.</p>
<figure>
<figcaption>Listing 2. N2O Context Setup</figcaption>
<code>
data Example = Greet deriving (Show, Eq, Read)
main = runServer "localhost" 3000 cx
cx = createCx router
router cx@Cx{cxReq=Req{reqPath=path}} =
let handler = case path of
"/ws/samples/static/index.html" -> index
"/ws/samples/static/about.html" -> about
_ -> index
in traceShow path cx{cxHandler=handler}
</code></figure>
<p>The idea to send prerendered JavaScript events over the
wire belongs to Rusty Klophaus who made Nitrogen Erlang web framework.
Later this was refined by N2O team and now is available
in its purity of Haskell.</p>
<figure>
<figcaption>Listing 3. NITRO Web Protocol</figcaption>
<code>
index Init = do
updateText "system" "What is your name?"
wireEl button{id="send", postback=Just Greet, source=["name"]}
index (Message Greet) = do
Just name <- get "name" -- wf:q/1
updateText "system" ("Hello, " <> jsEscape name <> "!")
about Init =
updateText "app" "This is the N2O Hello World App"
</code></figure>
<p>The N2O does not limit in developing only web applications.
N2O stack of protocols covers bus, storage, process interfaces.
Subscribe to follow Haskell implementations.</p>
</section>
<section>
<a name=plugin><h3>Documents</h3></a>
<div>
<ul>
<a href="man/web.htm">WEB</a></b>,
<a href="man/types.htm">TYPES</a></b>,
<a href="man/core.htm">CORE</a></b>,
<a href="man/protocols.htm">PROTOCOLS</a></b>,
<a href="man/nitro.htm">NITRO</a></b>.
</ul></div>
</section>
</main>
<footer>
Made with <span class="heart">❤</span> to Haskell and N2O
</footer>
</body>
</html>