forked from vert-x/vert-x.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_templ.html
347 lines (265 loc) · 9.85 KB
/
index_templ.html
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!-- PAGE HEADER -->
<div class="container">
<div class="row">
<div class="span9">
<div class="hero-unit" style="padding: 30px;">
<!-- <h1>Vert.x</h1> -->
<img src="logo-white-big.png"/>
<p class="highlight_title" style="font-size: 20px;">Vert.x is a lightweight, high performance application platform for the JVM that's designed
for modern mobile, web, and enterprise applications.</p>
</div>
</div>
<div class="span3">
<a href="http://jax.de/awards2014/voting"><img src="JAX_button.gif"/><a/>
</div>
</div>
<br />
<div class="row">
<div class="span3">
<div class="highlight">
<!--<div class="well"> -->
<h3 class="highlight_title">Polyglot</h3>
<br/>
<p>Write your application components in Java, JavaScript, CoffeeScript, Ruby,
Python or Groovy...</p>
<p>... or mix and match several programming languages in a single app.</p>
</div>
</div>
<div class="span3">
<div class="highlight">
<!--<div class="well"> -->
<h3 class="highlight_title">Simplicity</h3>
<br/>
<p>...without being simplistic. </p>
<p>Simple, powerful, APIs enable you to write non-blocking network enabled applications with
ease. No complex configuration or boilerplate required.</p>
</div>
</div>
<div class="span3">
<div class="highlight">
<!--<div class="well"> -->
<h3 class="highlight_title">Scalability</h3>
<br/>
<p>Scales using messaging passing to efficiently utilise your server cores.</p>
<p>Uses non blocking I/O to serve many connections with minimal threads.</p>
</div>
</div>
<div class="span3">
<div class="highlight">
<!--<div class="well"> -->
<h3 class="highlight_title">Concurrency</h3>
<br/>
<p>Simple <em>actor-like</em> concurrency model frees you from the pitfalls of traditional multi-threaded
programming.</p>
<p></p>
</div>
</div>
</div>
<br /><br />
<h3 class="highlight_title">Key Features</h3>
<br />
<div class="row">
<div class="span12">
<div class="well">
<br/>
<ul class="features">
<li>
<div class="keeptogether">
<p>
The <a href="core_manual_java.html#event-bus">Distributed Event Bus</a> is the nervous system of Vert.x and connects your
server-side components.
</p>
</div>
<div class="keeptogether">
<p>
Write your components in whatever language you want, and put them
where you want on your network. It even penetrates into JavaScript running in the browser!
</p>
</div>
</li>
<li>
<div class="keeptogether">
<p>
<a href="core_manual_java.html#web-sockets">WebSockets</a> and <a href="core_manual_java.html#sockjs">SockJS</a> support for real-time <i>server-push</i>
applications.
</p>
</div
</li>
<li>
<div class="keeptogether">
<p>If you don't want the whole platform, Vert.x can be <a href="embedding_manual.html">embedded</a> as a library in your
existing Java applications.
</p>
</div>
</li>
<li>
<div class="keeptogether">
<p>
Vert.x has a powerful <a href="mods_manual.html">module system</a>. Package your Vert.x components into modules for encapsulation and
reuse.
</p>
</div>
<div class="keeptogether">
<p>Share them with the community by putting them in Maven Central, any other Maven repository,
or in <a href="http://bintray.com">Bintray</a>.
</p>
</div>
<div class="keeptogether">
<p>Advertise your module in the <a href="http://modulereg.vertx.io">module registry</a>.
</p>
</div>
</li>
<li>
<div class="keeptogether">
<p>Seamlessly code, run, debug and test your Vert.x applications in your
favourite IDE.
</p>
</div>
<div class="keeptogether">
<p>Get started using Maven using the Maven <a href="maven_dev.html">archetype</a>
or using Gradle with the example Gradle <a href="gradle_dev.html">template project.</a>
</p>
</div>
<div class="keeptogether">
<p>Use <a href="dev_guide.html#auto-redeploy">auto-redeploy</a> to see your changes instantly in a running module.
</p>
</div>
</li>
<li>
<div class="keeptogether">
<p>100% open source. Licensed under the Apache Software License 2.0</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<br />
<h3 class="highlight_title">Here's an example web-server*</h3>
<br/>
<div class="row">
<div class="span12">
<ul class="nav nav-tabs">
<li class="active"><a href="#ws_js" data-toggle="tab">JavaScript</a></li>
<li><a href="#ws_java" data-toggle="tab">Java</a></li>
<li><a href="#ws_ruby" data-toggle="tab">Ruby</a></li>
<li><a href="#ws_groovy" data-toggle="tab">Groovy</a></li>
<li><a href="#ws_python" data-toggle="tab">Python</a></li>
<li><a href="#ws_clojure" data-toggle="tab">Clojure</a></li>
</ul>
<div class="well">
<div class="tab-content">
<div class="tab-pane active" id="ws_js">
<p>Save the following in <code>server.js</code></p>
<pre class="prettyprint">
var vertx = require('vertx');
vertx.createHttpServer().requestHandler(function(req) {
var file = req.path() === '/' ? 'index.html' : req.path();
req.response.sendFile('webroot/' + file);
}).listen(8080)
</pre>
<p>Run it:</p>
<p><code>vertx run server.js</code></p>
</div>
<div class="tab-pane" id="ws_java">
<p>Save the following in <code>Server.java</code></p>
<pre class="prettyprint">
import org.vertx.java.core.Handler;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.platform.Verticle;
public class Server extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
String file = req.path().equals("/") ? "index.html" : req.path();
req.response().sendFile("webroot/" + file);
}
}).listen(8080);
}
}
</pre>
<p>Run it: (note no compile is needed!)</p>
<p><code>vertx run Server.java</code></p>
</div>
<div class="tab-pane" id="ws_ruby">
<p>Save the following in <code>server.rb</code></p>
<pre class="prettyprint">
require "vertx"
Vertx::HttpServer.new.request_handler do |req|
file = req.uri == "/" ? "index.html" : req.uri
req.response.send_file "webroot/#{file}"
end.listen(8080)
</pre>
<p>Run it:</p>
<p><code>vertx run server.rb</code></p>
</div>
<div class="tab-pane" id="ws_groovy">
<p>Save the following in <code>Server.groovy</code></p>
<pre class="prettyprint">
vertx.createHttpServer().requestHandler { req ->
def file = req.uri == "/" ? "index.html" : req.uri
req.response.sendFile "webroot/$file"
}.listen(8080)
</pre>
<p>Run it:</p>
<p><code>vertx run Server.groovy</code></p>
</div>
<div class="tab-pane" id="ws_python">
<p>Save the following in <code>server.py</code></p>
<pre class="prettyprint">
import vertx
server = vertx.create_http_server()
@server.request_handler
def request_handler(req):
file = "index.html" if req.uri == "/" else req.uri
req.response.send_file("webroot/%s"%file)
server.listen(8080)
</pre>
<p>Run it:</p>
<p><code>vertx run server.py</code></p>
</div>
<div class="tab-pane" id="ws_clojure">
<p>Save the following in <code>server.clj</code></p>
<pre class="prettyprint">
(ns sample.server
(:require [vertx.html :as html]))
(-> http/server
(http/on-request
(fn [req]
(let [uri (.uri req)]
(-> req
http/server-response
(http/send-file (str "webroot/" (if (= "/" uri) "index.html" uri)))))))
(http/listen 8080))
</pre>
<p>Run it:</p>
<p><code>vertx run server.clj</code></p>
</div>
</div>
</div>
</div>
</div>
<h5 class="highlight_note">* In a real production web-server you would want to do some checking of the path to ensure files aren't served from outside the webroot!</h5>
<br />
<div class="row">
<div class="span12">
<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License"
align="center"
src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png"/></a>
This website is licensed under the <a rel="license"
href="http://creativecommons.org/licenses/by-sa/3.0/">Creative
Commons Attribution-ShareAlike 3.0 Unported License</a>.
<img src="Button-Built-on-CB-1.png" align="center"/>
</p>
</div>
</div>
</div>
<script src="js/jquery-1.7.1.min.js"></script>
<script src="bootstrap/js/bootstrap-tab.js"></script>
<script>
$(function () {
$('.tabs a:last').tab('show')
})
</script>
</body>
</html>