Files
zip/index.html
2014-01-28 04:21:08 -08:00

38 lines
2.6 KiB
HTML

<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="chrome=1"><title>Zip by zeekay</title><link rel="stylesheet" href="stylesheets/styles.css"><link rel="stylesheet" href="stylesheets/pygment_trac.css"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"><!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--><meta name="go-import" content="zeekay.io/zip git https://github.com/zeekay/zip"></head><body><div class="wrapper"><header><h1>Zip</h1><p>Zippy web framework for Go&period;</p><p class="view"><a href="https://github.com/zeekay/zip">View the Project on GitHub<small>zeekay&sol;zip</small></a></p><ul><li><a href="https://github.com/zeekay/zip/zipball/master">Download<strong>ZIP File</strong></a></li><li><a href="https://github.com/zeekay/zip/tarball/master">Download<strong>TAR Ball</strong></a></li><li><a href="https://github.com/zeekay/zip">View On<strong>GitHub</strong></a></li></ul></header><section><h1>zip</h1>
<p>A zippy web micro-framwork. Just a tiny bit of sugar for Go&#39;s excellent
<code>net/http</code> package. Inspired by <a href="http://bottlepy.org">bottle</a>, <a href="http://expressjs.com">express</a>, <a href="http://webgo.io">web.go</a>, etc.
</p>
<h2>Install</h2>
<p>Zip can be installed with <code>go get</code>:
</p>
<pre><code class="lang-bash">$ go get zeekay.io/zip</code></pre>
<h2>Usage</h2>
<p>A simple hello world web app looks like this:
</p>
<pre><code class="lang-go"><span class="keyword">package</span> main
<span class="keyword">import</span> <span class="string">"zeekay.io/zip"</span>
<span class="keyword">func</span> main() {
zip.Get(<span class="string">"/"</span>, <span class="keyword">func</span>(req zip.Req, res zip.Res) {
res.WriteString(<span class="string">"hello world!"</span>)
})
zip.Listen(<span class="string">":1337"</span>)
}</code></pre>
<p>You can run the server with <code>go run</code>:
</p>
<pre><code class="lang-bash">$ go run hello.go</code></pre>
<h2>Examples</h2>
<p>There are a few examples in <a href="https://github.com/zeekay/zip/blob/master/examples">examples/</a> for you to play with:
</p>
<ul>
<li><a href="https://github.com/zeekay/zip/blob/master/examples/hello/hello.go">hello.go</a></li>
<li><a href="https://github.com/zeekay/zip/blob/master/examples/json/json.go">json.go</a></li>
<li><a href="https://github.com/zeekay/zip/blob/master/examples/websocket/websocket.go">websocket.go</a></li>
</ul>
</section></div><script src="javascripts/scale.fix.js"></script></body></html>