-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
327 lines (312 loc) · 19.9 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Open source libraries for modern and blazing fast server software.">
<meta name="author" content="Zewo">
<meta property="og:title" content="Zewo" />
<meta property="og:description" content="Open source libraries for modern and blazing fast server software." />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.zewo.io/" />
<meta property="og:image" content="http://www.zewo.io/assets/images/logo-dark-large.png" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="400" />
<meta property="fb:app_id" content="679956515480783" />
<link rel="icon" href="favicon.ico">
<title>Zewo</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/tether/1.1.1/css/tether.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/xcode.min.css">
<link rel="stylesheet" type="text/css" href="/assets/styles/main.css">
<script>
/**
* Function that tracks a click on an outbound link in Analytics
* This function takes a valid URL string as an argument, and uses that URL string
* as the event label. Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
*/
var trackOutboundLink = function(url) {
if (ga.q) {
// Google Analytics is blocked
document.location = url;
} else {
ga('send', 'event', 'outbound', 'click', name, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
}
</script>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '679956515480783',
xfbml : true,
version : 'v2.5'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="pos-f-t">
<nav class="navbar navbar-static-top navbar-dark">
<div class="container">
<a class="navbar-brand" href="/">
<img class="logo-small" src="/assets/images/logo-small.png" srcset="/assets/images/logo-small.png 1x, /assets/images/[email protected] 2x, /assets/images/[email protected] 3x" alt="Logo">
<div class="logo-small-caption">Zewo</div>
</a>
<div class="pull-xs-right">
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#navbar-header" aria-controls="navbar-header">
☰
</button>
<div class="hidden-xs-down">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="https://github.com/Zewo/Zewo" onclick="trackOutboundLink('https://github.com/Zewo/Zewo', 'github'); return false;"><i class="fa fa-github"></i> GitHub</a>
</li>
<li class="nav-item">
<a class="nav-link" href="http://docs.zewo.io" onclick="trackOutboundLink('http://docs.zewo.io', 'docs'); return false;"><i class="fa fa-book"></i> Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://blog.zewo.io" onclick="trackOutboundLink('https://blog.zewo.io', 'blog'); return false;"><i class="fa fa-pencil"></i> Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="http://slack.zewo.io" onclick="trackOutboundLink('http://slack.zewo.io', 'slack'); return false;"><i class="fa fa-slack"></i> Slack</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://twitter.com/zewo_io" onclick="trackOutboundLink('https://twitter.com/zewo_io', 'twitter'); return false;"><i class="fa fa-twitter"></i> Twitter</a>
</li>
<li class="nav-item">
<a class="nav-link" href="mailto:[email protected]" onclick="trackOutboundLink('mailto:[email protected]', 'email'); return false;"><i class="fa fa-envelope"></i> Contact</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
<div class="collapse" id="navbar-header">
<div class="container-fluid bg-inverse p-a-1">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="https://github.com/Zewo/Zewo" onclick="trackOutboundLink('https://github.com/Zewo/Zewo', 'github-mobile'); return false;"><i class="fa fa-github"></i> Github</a>
</li>
<li class="nav-item">
<a class="nav-link" href="http://docs.zewo.io" onclick="trackOutboundLink('http://docs.zewo.io', 'docs-mobile'); return false;"><i class="fa fa-book"></i> Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://blog.zewo.io" onclick="trackOutboundLink('https://blog.zewo.io', 'blog-mobile'); return false;"><i class="fa fa-pencil"></i> Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="http://slack.zewo.io" onclick="trackOutboundLink('http://slack.zewo.io', 'slack-mobile'); return false;"><i class="fa fa-slack"></i> Slack</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://twitter.com/zewo_io" onclick="trackOutboundLink('https://twitter.com/zewo_io', 'twitter-mobile'); return false;"><i class="fa fa-twitter"></i> Twitter</a>
</li>
<li class="nav-item">
<a class="nav-link" href="mailto:[email protected]" onclick="trackOutboundLink('mailto:[email protected]', 'email-mobile'); return false;"><i class="fa fa-envelope"></i> Contact</a>
</li>
</ul>
</div>
</div>
</div>
<div class="hero">
<div class="hero-caption container">
<img id="logo-large" src="/assets/images/logo-large.png" srcset="/assets/images/logo-large.png 1x, /assets/images/[email protected] 2x, /assets/images/[email protected] 3x" alt="Logo">
<h2>Zewo</h2>
<h1>Build server software in Swift</h1>
<h3>Zewo is a set of open source libraries that help you build <br class="hero-caption-break">modern and blazing fast server software.</h3>
<a href="https://github.com/Zewo/Zewo" onclick="trackOutboundLink('https://github.com/Zewo/Zewo', 'github-cta-1'); return false;">
<img class="github-button" src="/assets/images/get-started-on-github.svg" alt="Github">
</a>
</div>
</div>
<div class="marketing">
<div class="row featurette">
<div class="container">
<div class="col-md-4">
<img class="featurette-image center-block" src="/assets/images/feature-linux.svg" alt="Linux ready">
</div>
<div class="col-md-8">
<h2>Linux ready</h2>
<h3>Compiled Swift, running on your Linux distribution.</h3>
<p>As Swift is open source and capable of running on Linux, you can easily deploy Zewo on AWS, DigitalOcean, or any of your other favorite cloud infrastructure provider.</p>
</div>
<!--
<div class="col-md-12 snippet-row">
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active">HTTP Server</li>
<li data-target="#myCarousel" data-slide-to="1">Router</li>
<li data-target="#myCarousel" data-slide-to="2">Middleware</li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active" style="padding: 1rem;">
<div style="text-align: center; padding-bottom: 1rem;">
Zewo provides fast and reliable HTTP/HTTPS servers. Our servers are crafted with the same battle-tested HTTP parser used by nginx/node.js, so you can be sure we'll take good care of your requests. TLS/SSL is handled by OpenSSL, which is the most popular SSL implementation powering only about 2/3 of all webservers around the world.
</div>
<pre><code class="hljs swift">import HTTPServer
import HTTPSServer
let hello = Responder { request in
return Response(body: "hello world")
}
try Server(
<span data-toggle="tooltip" title="With reusePort enabled you can run as many process instances as you like, all listening on the same address/port combination.">reusePort</span>: true,
port: 80,
responder: hello
).<span data-toggle="tooltip" title="If you want to run more than one server listening on different ports on the same process, just start one of them in the background.">startInBackground()</span>
try Server(
reusePort: true,
port: 443,
certificate: "cert.pem",
privateKey: "key.pem",
<span data-toggle="tooltip" title="A responder is simply a type that receives an HTTP request and returns an HTTP response. Router will probably be the responder you'll use the most here.">responder</span>: hello
).start()</code></pre>
</div>
<div class="carousel-item" style="padding: 1rem;">
<div style="text-align: center; padding-bottom: 1rem;">
You'll probably want to use a router to organize your web application. Luckily, we have an excellent Router module for that.
</div>
<pre><code class="hljs swift">import HTTPServer
import Router
import <span data-toggle="tooltip" title="You can add functionality to the Router through extensions defined in another module.">ResourcefulRoute</span>
let v1 = Router("/v1") { route in
route.post("/users", CreateUserResponder())
}
let app = Router(<span data-toggle="tooltip" title="Router is flexible and allows you to supply your own route matcher if you please.">matcher</span>: TrieRouteMatcher.self) { route in
route.get("/hello") { _ in
return Response(body: "hello world")
}
route.get("/hello/<span data-toggle="tooltip" title="Define path parameters using ':parameterName' syntax.">:name</span>") { request in
let name = request.<span data-toggle="tooltip" title="Access path parameters through the pathParameters property.">pathParameters</span>["name"]!
return Response(body: "hello \(name)")
}
route.<span data-toggle="tooltip" title="You can compose routers within routers. This allows you to better organize and reuse your code.">compose</span>("/api", v1)
route.<span data-toggle="tooltip" title="Through extensions you could add opinionated functions like resource that creates all routes needed for a resource.">resources</span>("/videos", VideoResources())
route.<span data-toggle="tooltip" title="Fallback lets you serve static files from a chosen directory, for example.">fallback</span> = FileResponder(path: "public")
}
try Server(app).start()</code></pre>
</div>
<div class="carousel-item" style="padding: 1rem;">
<div style="text-align: center; padding-bottom: 1rem;">
Middleware allows you to reuse code for common tasks and make your life a lot easier.
</div>
<pre><code class="hljs swift">import <span data-toggle="tooltip" title="We provide an umbrella package that contains the most important Zewo modules.">Zewo</span>
let logger = LoggerMiddleware(log: Log())
let contentNegotiator = ContentNegotiationMiddleware(mediaTypes: JSONMediaType(), URLEncodedFormMediaType())
let userMapper = ContentMapperMiddleware(mappingTo: User.self)
let app = Router(middleware: contentNegotiator) { route in
route.post("/users", middleware: userMapper) { request in
guard let user = request.<span data-toggle="tooltip" title="You can define type-safe computed properties to requests through extensions.">user</span> else {
return Response(status: .BadRequest)
}
let id = User.save(user)
return Response(content: id)
}
}
try Server(<span data-toggle="tooltip" title="Middleware are applied to responders. So almost all places that take a responder can also take middleware. Server, router, routes, etc.">middleware</span>: logger, responder: app).start()</code></pre>
</div>
</div>
</div>
</div>
!-->
</div>
</div>
<div class="row featurette alt">
<div class="container">
<div class="col-md-4 col-md-push-8">
<img class="featurette-image center-block" src="/assets/images/feature-concurrency.svg" alt="Concurrency with Venice">
</div>
<div class="col-md-7 col-md-pull-3">
<h2>Go-style concurrency</h2>
<h3>Concurrent programming without callbacks</h3>
<p>
What many have come to love with the <a href="https://golang.org" target="_blank">Go</a> programming language is its concurrency model. Go uses <a href="https://en.wikipedia.org/wiki/Communicating_sequential_processes" target="_blank">CSP</a> (Communicating Sequential Processes), which Zewo brings to Swift using <a href="http://libmill.org" target="_blank">libmill</a>. Say goodbye to callback hell, and meet your new favourite way of building concurrent software!
</p>
</div>
</div>
</div>
<div class="row featurette">
<div class="container">
<div class="col-md-4">
<img class="featurette-image center-block" src="/assets/images/feature-docker.svg" alt="Docker support">
</div>
<div class="col-md-8">
<h2>Ship your code safely</h2>
<h3>Containers for each version</h3>
<p>Swift is a living language that improves at a fast rate. Zewo provides you with utilities, such as Docker images for each release, so you can deploy your code safely.</p>
</div>
</div>
</div>
<div class="row featurette alt">
<div class="container">
<div class="col-md-4 col-md-push-8">
<img class="featurette-image center-block" src="/assets/images/feature-platform.svg" alt="Platform">
</div>
<div class="col-md-7 col-md-pull-3">
<h2>Zewo is a platform</h2>
<h3>Build the next generation web framework with Zewo</h3>
<p>Thanks to Zewo’s modularity, you can pick and choose what you want to use for your own framework - whether it be Venice for concurrency, the HTTP Server, the included Trie-based router matcher for your Router, or one of our many other components.</p>
</div>
</div>
</div>
<div class="row featurette">
<div class="container">
<div class="col-md-4">
<img class="featurette-image center-block" src="/assets/images/feature-mit.svg" alt="MIT Licensed">
</div>
<div class="col-md-8">
<h2>MIT Licensed</h2>
<h3>Contribute to everyone, without reservation.</h3>
<p>The entire Zewo code base is licensed under <a href="https://opensource.org/licenses/MIT" target="_blank">MIT</a>. By contributing to Zewo you are contributing to an open and engaged community of brilliant Swift programmers. Join us on <a href="http://slack.zewo.io" target="_blank">Slack</a> to get to know us!</p>
</div>
</div>
</div>
</div>
<footer class="footer navbar-dark">
<p>© 2016 Zewo</p>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.1.1/js/tether.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/languages/swift.min.js"></script>
<script src="https://v4-alpha.getbootstrap.com/assets/js/ie10-viewport-bug-workaround.js"></script>
<script>
$('.hljs').each(function(i, block) {
hljs.highlightBlock(block);
});
$('[data-toggle="tooltip"]').tooltip({
placement: "right"
});
</script>
<script type="text/javascript">
var _mfq = _mfq || [];
(function() {
var mf = document.createElement("script");
mf.type = "text/javascript"; mf.async = true;
mf.src = "//cdn.mouseflow.com/projects/e7a386d3-cabb-491e-ae5a-37c76ad80cfd.js";
document.getElementsByTagName("head")[0].appendChild(mf);
})();
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-74502049-1', 'auto');
ga('send', 'pageview');
setTimeout(function(){ga('send','event','engagement','30 seconds')}, 30000);
</script>
</body>
</html>